log15 1.0.1 → 1.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/log15/logger.rb +2 -1
- data/lib/log15/version.rb +1 -1
- data/spec/log15/logger_spec.rb +5 -5
- 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: 1c678e40327d2e4a48c7b3b259f60c8af680105d
|
4
|
+
data.tar.gz: 6d391a71dbc92e58144ebeeec9b666270b165ff1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e011e4081d11de9f681182216709da1602dd4faaec30fa09649509b76f556314ea86d7975520bc3b40cf3ae080ff201eb3b666a4d6f16921de368e47bbd3217d
|
7
|
+
data.tar.gz: 6efa3aeacd6025948cc5eebcdbf40a3c8dc5e323c21d9425c2cd2743942530588b5684aae86029a52248af44e00b10af491cfcbee4c67fec4cd8cb73ffadb405
|
data/lib/log15/logger.rb
CHANGED
@@ -10,8 +10,9 @@ module Log15
|
|
10
10
|
date = "#{datetime.month}-#{datetime.day}"
|
11
11
|
time = "#{pad(datetime.hour)}:#{pad(datetime.min)}:#{pad(datetime.sec)}"
|
12
12
|
severities = { "ERROR" => "EROR", "DEBUG" => "DBUG" }
|
13
|
+
original_severity = severity
|
13
14
|
severity = severities.fetch(severity, severity)
|
14
|
-
"#{severity}[#{date}|#{time}] #{msg}\n"
|
15
|
+
"#{severity}[#{date}|#{time}] #{msg} lvl=#{original_severity.downcase}\n"
|
15
16
|
end
|
16
17
|
end
|
17
18
|
|
data/lib/log15/version.rb
CHANGED
data/spec/log15/logger_spec.rb
CHANGED
@@ -11,7 +11,7 @@ describe Log15 do
|
|
11
11
|
output = log.string
|
12
12
|
expect(output).to match(/^INFO/)
|
13
13
|
expect(output).to match(/\[\d{2}-\d{2}|\d{2}:\d{2}:\d{2}\]/)
|
14
|
-
expect(output).to match(/msg foo="bar" baz="foo"\n$/)
|
14
|
+
expect(output).to match(/msg foo="bar" baz="foo" lvl=info\n$/)
|
15
15
|
end
|
16
16
|
|
17
17
|
it "message with quotes" do
|
@@ -19,7 +19,7 @@ describe Log15 do
|
|
19
19
|
output = log.string
|
20
20
|
expect(output).to match(/^INFO/)
|
21
21
|
expect(output).to match(/\[\d{2}-\d{2}|\d{2}:\d{2}:\d{2}\]/)
|
22
|
-
expect(output).to match(/msg foo="\\\"bar\\\""\n$/)
|
22
|
+
expect(output).to match(/msg foo="\\\"bar\\\"" lvl=info\n$/)
|
23
23
|
end
|
24
24
|
|
25
25
|
it "message with nested hash" do
|
@@ -27,7 +27,7 @@ describe Log15 do
|
|
27
27
|
output = log.string
|
28
28
|
expect(output).to match(/^INFO/)
|
29
29
|
expect(output).to match(/\[\d{2}-\d{2}|\d{2}:\d{2}:\d{2}\]/)
|
30
|
-
expect(output).to match(/msg foo="{\\\"bar\\\":\\\"baz\\\"}"\n$/)
|
30
|
+
expect(output).to match(/msg foo="{\\\"bar\\\":\\\"baz\\\"}" lvl=info\n$/)
|
31
31
|
end
|
32
32
|
|
33
33
|
it "message with nested array" do
|
@@ -35,7 +35,7 @@ describe Log15 do
|
|
35
35
|
output = log.string
|
36
36
|
expect(output).to match(/^INFO/)
|
37
37
|
expect(output).to match(/\[\d{2}-\d{2}|\d{2}:\d{2}:\d{2}\]/)
|
38
|
-
expect(output).to match(/msg foo="\[\\\"bar\\\",\\\"baz\\\"\]"\n$/)
|
38
|
+
expect(output).to match(/msg foo="\[\\\"bar\\\",\\\"baz\\\"\]" lvl=info\n$/)
|
39
39
|
end
|
40
40
|
end
|
41
41
|
|
@@ -45,7 +45,7 @@ describe Log15 do
|
|
45
45
|
output = log.string
|
46
46
|
expect(output).to match(/^DBUG/)
|
47
47
|
expect(output).to match(/\[\d{2}-\d{2}|\d{2}:\d{2}:\d{2}\]/)
|
48
|
-
expect(output).to match(/msg foo="bar"\n$/)
|
48
|
+
expect(output).to match(/msg foo="bar" lvl=debug\n$/)
|
49
49
|
end
|
50
50
|
end
|
51
51
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: log15
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ryan Bigg
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-11
|
11
|
+
date: 2014-12-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: json
|