lorekeeper 1.3.0 → 1.3.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 3c57e4384fccde817a60496b1a82d00b5c6f5c30
4
- data.tar.gz: c68a007d458b589ab9d4db7a3da87025774df172
3
+ metadata.gz: e883e332d3819a40caeecf907cdfad9d8ae3bfe9
4
+ data.tar.gz: 49b9d5aa078a5993dcbdeca154e085e2e9f0e6f0
5
5
  SHA512:
6
- metadata.gz: 4ddebaffb6c6ccaab8c5cc70d2d51e300577d928729fc022322cb6ddbf6deda9fdecf12d9cdc2f0851d8935871481252ab27a9791eda94778b4775f6d7d4f8f5
7
- data.tar.gz: 5c90023c007a07e9796c16abdeb85fba5f467a454c29bf8e5c2932c848192b7e0dddd838dc0b6ac0da67181901e8eb152b6a34dfb0e7e64b3ad9b48c7e7fb2bd
6
+ metadata.gz: 52e39e1aea389a5f13bfcb370c6832d8f57abc3dbabc4253ed157c5b03c9b97d58737440127098de1b7bb89099454e08c70357fb077a2c6d5d90e820a37e7f31
7
+ data.tar.gz: 491b6d0007bfdfaa8c105a98d99257cf78d9dc03140414b34272af2db13c8c3f7c3e70b4b099b25d83e4088e3597419d112fac24e927d4b22f519bc9c707b796
data/CHANGELOG.md CHANGED
@@ -1,3 +1,6 @@
1
+ # 1.3.1
2
+ Loggers provide an inspect method to avoid being too noisy on outputs
3
+
1
4
  # 1.3.0
2
5
  Time in the JSON output specifies microseconds.
3
6
  Using 'Z' to specify the UTC timezone instead of +0000 as per ISO 8601.
@@ -18,6 +18,7 @@ module Lorekeeper
18
18
  def initialize(file)
19
19
  @level = DEBUG
20
20
  @iodevice = LogDevice.new(file)
21
+ @file = file # We only keep this so we can inspect where we are sending the logs
21
22
  end
22
23
 
23
24
  LOGGING_METHODS = %i(debug info warn error fatal)
@@ -88,7 +89,7 @@ module Lorekeeper
88
89
 
89
90
  def open_logfile(filename)
90
91
  File.open(filename, (File::WRONLY | File::APPEND))
91
- rescue Errno::ENOENT => e
92
+ rescue Errno::ENOENT
92
93
  create_logfile(filename)
93
94
  end
94
95
 
@@ -81,6 +81,10 @@ module Lorekeeper
81
81
  end
82
82
  end
83
83
 
84
+ def inspect
85
+ "Lorekeeper JSON logger. IO: #{@file.inspect}"
86
+ end
87
+
84
88
  private
85
89
 
86
90
  THREAD_KEY = 'lorekeeper_jsonlogger_key'.freeze # Shared by all threads but unique by thread
@@ -136,6 +140,10 @@ module Lorekeeper
136
140
  color = SEVERITY_TO_COLOR_MAP[severity]
137
141
  @iodevice.write("\e[#{color}m#{message}\e[0m\n")
138
142
  end
143
+
144
+ def inspect
145
+ "Lorekeeper Simple logger. IO: #{@file.inspect}"
146
+ end
139
147
  end
140
148
 
141
149
 
@@ -11,6 +11,10 @@ module Lorekeeper
11
11
  @loggers << logger
12
12
  end
13
13
 
14
+ def inspect
15
+ "Lorekeeper multilogger, loggers: #{@loggers.map(&:inspect)}"
16
+ end
17
+
14
18
  def method_missing(method, *args, &block)
15
19
  result = @loggers.map do |logger|
16
20
  logger.public_send(method, *args, &block) if logger.respond_to?(method)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
  # The comment above will make all strings in a current file frozen
3
3
  module Lorekeeper
4
- VERSION = '1.3.0'.freeze
4
+ VERSION = '1.3.1'.freeze
5
5
  end
data/lorekeeper.gemspec CHANGED
@@ -12,7 +12,7 @@ Gem::Specification.new do |spec|
12
12
 
13
13
  spec.summary = ' Very fast JSON logger '
14
14
  spec.description = ' Opinionated logger which outputs messages in JSON format '
15
- spec.homepage = 'http://www.gihub.com/jordipolo/lorekeeper'
15
+ spec.homepage = 'http://www.github.com/jordipolo/lorekeeper'
16
16
  spec.license = 'MIT'
17
17
 
18
18
  spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lorekeeper
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.0
4
+ version: 1.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jordi Polo
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-02-28 00:00:00.000000000 Z
11
+ date: 2016-03-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: oj
@@ -146,7 +146,7 @@ files:
146
146
  - lib/lorekeeper/multi_logger.rb
147
147
  - lib/lorekeeper/version.rb
148
148
  - lorekeeper.gemspec
149
- homepage: http://www.gihub.com/jordipolo/lorekeeper
149
+ homepage: http://www.github.com/jordipolo/lorekeeper
150
150
  licenses:
151
151
  - MIT
152
152
  metadata: {}
@@ -166,7 +166,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
166
166
  version: '0'
167
167
  requirements: []
168
168
  rubyforge_project:
169
- rubygems_version: 2.5.1
169
+ rubygems_version: 2.4.8
170
170
  signing_key:
171
171
  specification_version: 4
172
172
  summary: Very fast JSON logger