logfoo 0.1.0 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fd6552b5ede8394f59cbe1f21700c0024a57d390
|
4
|
+
data.tar.gz: 5fb14524939a4c320d1fa0210a6b3d8eaf872818
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3dfb0cbd91d74112967ffabdc1fcdffdc888ad8e1e691b6b0df1cfed653afc807862d98a35441cce3427a1306f568d795a041a31a67f3ac4780e0ca5d82df92b
|
7
|
+
data.tar.gz: bf421ff6a62ae19f90555d63dec3c3d5bf91d497cab87b149e133ade8572690fc02cd71e70d05770b18bad4a431fd34b4171d87a1e08032900fabd59b8d741ae
|
@@ -11,9 +11,9 @@ module Logfoo
|
|
11
11
|
def call(entry)
|
12
12
|
case entry
|
13
13
|
when ExceptionEntry, Entry
|
14
|
-
|
14
|
+
format_entry(entry)
|
15
15
|
else
|
16
|
-
remove_nl entry.to_s
|
16
|
+
"#{remove_nl entry.to_s}\n"
|
17
17
|
end
|
18
18
|
end
|
19
19
|
|
@@ -24,7 +24,7 @@ module Logfoo
|
|
24
24
|
end
|
25
25
|
|
26
26
|
def format_entry(entry)
|
27
|
-
"#{format_hash(entry.to_h)}\n"
|
27
|
+
"#{remove_nl format_hash(entry.to_h)}\n"
|
28
28
|
end
|
29
29
|
|
30
30
|
def format_hash(attrs)
|
@@ -11,7 +11,7 @@ module Logfoo
|
|
11
11
|
attrs = entry.to_h
|
12
12
|
attrs.delete(:backtrace)
|
13
13
|
str = []
|
14
|
-
str << "#{format_hash(entry.to_h)}\n"
|
14
|
+
str << "#{remove_nl format_hash(entry.to_h)}\n"
|
15
15
|
if entry.is_a?(ExceptionEntry)
|
16
16
|
str << format_exception(entry)
|
17
17
|
end
|
@@ -30,7 +30,7 @@ module Logfoo
|
|
30
30
|
def format_hash(attrs)
|
31
31
|
level = attrs.delete(:level)
|
32
32
|
message = attrs.delete(:msg)
|
33
|
-
|
33
|
+
logger = attrs.delete(:logger)
|
34
34
|
|
35
35
|
IGNORED_KEYS.each do |f|
|
36
36
|
attrs.delete(f)
|
@@ -39,7 +39,7 @@ module Logfoo
|
|
39
39
|
payload = super(attrs)
|
40
40
|
payload = payload.empty? ? "" : " [#{payload}]"
|
41
41
|
message = message.to_s.empty? ? "" : " #{message}"
|
42
|
-
FORMAT % [level.upcase,
|
42
|
+
FORMAT % [level.upcase, logger, message, payload]
|
43
43
|
end
|
44
44
|
end
|
45
45
|
end
|
data/lib/logfoo/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: logfoo
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dmitry Galinsky
|
@@ -135,3 +135,4 @@ signing_key:
|
|
135
135
|
specification_version: 4
|
136
136
|
summary: Write a short summary, because Rubygems requires one.
|
137
137
|
test_files: []
|
138
|
+
has_rdoc:
|