slog 1.1.1 → 1.1.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (7) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +2 -1
  3. data/Rakefile +1 -1
  4. data/VERSION +1 -1
  5. data/lib/slog/logger.rb +12 -14
  6. data/lib/slog.rb +4 -0
  7. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 99914e76d76c773206dcb93cdec75fc345b0b9fc
4
- data.tar.gz: a04c6a5bb361622561ec6ef4ee9e8f265e746c14
3
+ metadata.gz: 807f84e2e864292179810e7450ac37696a2f5f16
4
+ data.tar.gz: a788a44e6f8d9bff31b07c8d99524345662cb795
5
5
  SHA512:
6
- metadata.gz: 72ad6cba650e07f38f4ad412943de1ea6e2a84d5758c961eb631c3130141635f510e17d5ae61a1ac72eb211e27f03aad45434cf12a4b701547148b594692bbd8
7
- data.tar.gz: b2fffa51afc6f89660091c28a709ca177d1ac1950eea0987dd843dd57602878e10be4d7a277ff8bd4dc5a1d6f301ed708c9de1bef4835b06afd2e0101034e904
6
+ metadata.gz: 8403f63e3dcfd2ffdc5837933884ae6bc85ab22853e7ae1e5ff731c7548dfd901ff90a684f3e2e18e370d9937bc7bd4edd4d6dd8c950ca709795d2d7824328fb
7
+ data.tar.gz: acaf99f7d3cc3732b0b9a276f91e6c4279dcc4bf2ac5952592abdfe301ac2e884bf9e059c5430f7b5c2cb5eb76b6cce11202fef3ae28cb656c1af69443d71af2
data/README.md CHANGED
@@ -79,7 +79,8 @@ Slog.new({
79
79
  #
80
80
  # {
81
81
  # "event": "example",
82
- # "level": "MINE"
82
+ # "level": "MINE",
83
+ # "@timestamp": null
83
84
  # }
84
85
  #
85
86
  ```
data/Rakefile CHANGED
@@ -15,7 +15,7 @@ task default: :test
15
15
 
16
16
  require 'yard'
17
17
  YARD::Rake::YardocTask.new do |t|
18
- t.files = %w[ --readme Readme.md lib/**/*.rb - VERSION LICENSE ]
18
+ t.files = %w[ --readme README.md lib/**/*.rb - VERSION LICENSE ]
19
19
  end
20
20
 
21
21
 
data/VERSION CHANGED
@@ -1 +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:$stdout, # Output handle
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:DEFAULT_LEVEL, # INFO
46
- level_transform:'downcase', # Any String method
47
- level_field:'level', # nil to disable
48
- message_field: 'message', # nil to disable
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 == DEFAULT_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
@@ -1,7 +1,11 @@
1
1
  require_relative 'slog/logger'
2
2
 
3
+
3
4
  module Slog
5
+
6
+ # Provide a shortcut to Slog::Logger.new
4
7
  def self.new *opts
5
8
  Logger.new *opts
6
9
  end
10
+
7
11
  end
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.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: 2014-12-26 00:00:00.000000000 Z
11
+ date: 2015-01-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: colorize