blabbermouth-rails 0.0.4 → 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/blabbermouth/rails/bystander.rb +12 -17
- data/lib/blabbermouth/rails/version.rb +2 -1
- data/spec/spec_helper.rb +2 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: aa15487be8aed03653a0f84579c5f1275d606c1a
|
4
|
+
data.tar.gz: eced4d83a94cdb928e7641aa21f5e08e63831965
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 70e6ce81d29762d0701a2a04e25de368a211c97e09ab2f917ba1bd73c7008facb80b9c1ebfa2e780ad18d3f329dae7eb5a2bbea663fd7ece66fdb909e8ab2ccf
|
7
|
+
data.tar.gz: 4429a8a5103673364c1bcccd2f7ab6691829e3176cd179200b1bf75f42040d84544f64eda36fa42c0680a435922514b72382963a1e6de8996f74c60390fd0682
|
@@ -1,29 +1,31 @@
|
|
1
1
|
module Blabbermouth
|
2
2
|
module Bystanders
|
3
3
|
class Rails < Base
|
4
|
+
include Blabbermouth::Bystanders::Formatter
|
5
|
+
|
4
6
|
def error(key, e, *args)
|
5
|
-
|
6
|
-
log :error, key, e.message, data
|
7
|
+
blab :error, key, e, *args
|
7
8
|
end
|
8
9
|
|
9
10
|
def info(key, msg=nil, *args)
|
10
|
-
|
11
|
-
log :info, key, msg, data
|
11
|
+
blab :info, key, msg, *args
|
12
12
|
end
|
13
13
|
|
14
14
|
def increment(key, by=1, *args)
|
15
|
-
|
16
|
-
log :increment, key, by, data
|
15
|
+
blab :increment, key, by, *args
|
17
16
|
end
|
18
17
|
|
19
18
|
def count(key, total, *args)
|
20
|
-
|
21
|
-
log :count, key, total, data
|
19
|
+
blab :count, key, total, *args
|
22
20
|
end
|
23
21
|
|
24
|
-
def time(key,
|
22
|
+
def time(key, duration, *args)
|
23
|
+
blab :time, key, duration, *args
|
24
|
+
end
|
25
|
+
|
26
|
+
def blab(meth, key, value, *args)
|
25
27
|
data, opts, args = parse_args(*args)
|
26
|
-
log
|
28
|
+
log meth, key, value, data
|
27
29
|
end
|
28
30
|
|
29
31
|
protected
|
@@ -40,13 +42,6 @@ module Blabbermouth
|
|
40
42
|
rails? ? ::Rails.logger.info(message) : puts(message)
|
41
43
|
end
|
42
44
|
end
|
43
|
-
|
44
|
-
def log_message(event, key, msg, data={})
|
45
|
-
message = "[#{::Time.now.strftime('%Y/%m/%d %H:%M:%S %Z')}] Blabbermouth.#{event.to_s}: #{key.to_s}"
|
46
|
-
message += ": #{msg.to_s}" unless msg.to_s.blank?
|
47
|
-
message += " #{data.to_s}"
|
48
|
-
message
|
49
|
-
end
|
50
45
|
end
|
51
46
|
end
|
52
47
|
end
|
data/spec/spec_helper.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: blabbermouth-rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mark Rebec
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-05-
|
11
|
+
date: 2015-05-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: blabbermouth
|