slog 1.1.1 → 1.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +2 -1
- data/Rakefile +1 -1
- data/VERSION +1 -1
- data/lib/slog/logger.rb +12 -14
- data/lib/slog.rb +4 -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: 807f84e2e864292179810e7450ac37696a2f5f16
|
4
|
+
data.tar.gz: a788a44e6f8d9bff31b07c8d99524345662cb795
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8403f63e3dcfd2ffdc5837933884ae6bc85ab22853e7ae1e5ff731c7548dfd901ff90a684f3e2e18e370d9937bc7bd4edd4d6dd8c950ca709795d2d7824328fb
|
7
|
+
data.tar.gz: acaf99f7d3cc3732b0b9a276f91e6c4279dcc4bf2ac5952592abdfe301ac2e884bf9e059c5430f7b5c2cb5eb76b6cce11202fef3ae28cb656c1af69443d71af2
|
data/README.md
CHANGED
data/Rakefile
CHANGED
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.1.
|
1
|
+
1.1.2
|
data/lib/slog/logger.rb
CHANGED
@@ -29,25 +29,23 @@ module Slog
|
|
29
29
|
# A colorful structured logger.
|
30
30
|
class Logger < Logger
|
31
31
|
|
32
|
-
DEFAULT_LEVEL = ::Logger::INFO
|
33
|
-
|
34
32
|
# Create a new Logger.
|
35
33
|
#
|
36
34
|
# A little different than the canonical Logger. Add options to set the
|
37
35
|
# log level and to disable both colorization and pretty JSON output. In
|
38
36
|
# this form, it's perfect for use with either Logstash or Franz.
|
39
37
|
def initialize \
|
40
|
-
out
|
41
|
-
shift_age:7, # Max seven logs
|
42
|
-
shift_size:1_048_576, # 1024 KiB
|
43
|
-
colorize:true, # Disable for files
|
44
|
-
prettify:true, # Disable for files
|
45
|
-
level:
|
46
|
-
level_transform:'downcase', # Any String method
|
47
|
-
level_field:'level', # nil to disable
|
48
|
-
message_field: 'message',
|
49
|
-
timestamp_field:'@timestamp', # nil to disable
|
50
|
-
timestamp_format:'%FT%T.%3N%:z', # ISO-8601
|
38
|
+
out: $stdout, # Output handle
|
39
|
+
shift_age: 7, # Max seven logs
|
40
|
+
shift_size: 1_048_576, # 1024 KiB
|
41
|
+
colorize: true, # Disable for files
|
42
|
+
prettify: true, # Disable for files
|
43
|
+
level: :info, # INFO
|
44
|
+
level_transform: 'downcase', # Any String method
|
45
|
+
level_field: 'level', # nil to disable
|
46
|
+
message_field: 'message', # nil to disable
|
47
|
+
timestamp_field: '@timestamp', # nil to disable
|
48
|
+
timestamp_format: '%FT%T.%3N%:z', # ISO-8601
|
51
49
|
color_map: {
|
52
50
|
'debug' => [ :blue, :default ],
|
53
51
|
'info' => [ :green, :default ],
|
@@ -82,7 +80,7 @@ module Slog
|
|
82
80
|
event = structure_event severity, datetime, message
|
83
81
|
|
84
82
|
# When debugging, mark the location in Hoss's source
|
85
|
-
unless level ==
|
83
|
+
unless level == ::Logger::INFO
|
86
84
|
event.merge! marker: File.basename(caller[4])
|
87
85
|
end
|
88
86
|
|
data/lib/slog.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: slog
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sean Clemmer
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2015-01-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: colorize
|