lorekeeper 1.2.1 → 1.3.0

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: 9fb9c7cab3e4f19d195751e8b24eaa616eb60940
4
- data.tar.gz: 57381c101b3aca75f0b30ca1439debf52a1269c3
3
+ metadata.gz: 3c57e4384fccde817a60496b1a82d00b5c6f5c30
4
+ data.tar.gz: c68a007d458b589ab9d4db7a3da87025774df172
5
5
  SHA512:
6
- metadata.gz: 43abb0bd8d32c1355c1edc7a701a9519bbd10eef45bb4c28daf8c283697de387f1faabaacc1153f2286f0c7365ce8b0c2d704c9902402852b15172d6a93e4f86
7
- data.tar.gz: f5d5adef019602b137a74c679ab3bce07d749bf5f9fd1e3e37e7fd1be70dd0f47e4d0694e6ea3aa83ce67be5d1ef7397226b8c174760528a7de1d66b5df751e5
6
+ metadata.gz: 4ddebaffb6c6ccaab8c5cc70d2d51e300577d928729fc022322cb6ddbf6deda9fdecf12d9cdc2f0851d8935871481252ab27a9791eda94778b4775f6d7d4f8f5
7
+ data.tar.gz: 5c90023c007a07e9796c16abdeb85fba5f467a454c29bf8e5c2932c848192b7e0dddd838dc0b6ac0da67181901e8eb152b6a34dfb0e7e64b3ad9b48c7e7fb2bd
@@ -1,7 +1,9 @@
1
- language: ruby
1
+ language: 'ruby'
2
+ cache: 'bundler'
3
+ sudo: false
4
+
2
5
  rvm:
3
6
  - 2.1.8
4
7
  - 2.2.4
5
8
  - 2.3.0
6
-
7
9
  script: 'bundle exec rspec'
@@ -1,3 +1,8 @@
1
+ # 1.3.0
2
+ Time in the JSON output specifies microseconds.
3
+ Using 'Z' to specify the UTC timezone instead of +0000 as per ISO 8601.
4
+ Debug and Info messages use the default foreground color of the terminal.
5
+
1
6
  # 1.2.1
2
7
  If a file does not exist, it will create it on behalf of the application
3
8
 
@@ -86,7 +86,7 @@ module Lorekeeper
86
86
  THREAD_KEY = 'lorekeeper_jsonlogger_key'.freeze # Shared by all threads but unique by thread
87
87
  MESSAGE = 'message'.freeze
88
88
  TIMESTAMP = 'timestamp'.freeze
89
- DATE_FORMAT = '%FT%T.%L%z'.freeze
89
+ DATE_FORMAT = '%FT%T.%6NZ'.freeze
90
90
 
91
91
  def with_extra_fields(fields)
92
92
  state[:extra_fields] = fields
@@ -111,20 +111,30 @@ module Lorekeeper
111
111
  fields_to_log[MESSAGE] = message
112
112
  fields_to_log[TIMESTAMP] = Time.now.utc.strftime(DATE_FORMAT)
113
113
 
114
- @iodevice.write(Oj.dump(fields_to_log) + "\n")
114
+ @iodevice.write(Oj.dump(fields_to_log) << "\n")
115
115
  end
116
116
  end
117
117
 
118
118
  # Simple logger which tries to have an easy to see output.
119
119
  class SimpleLogger < FastLogger
120
+ # From http://misc.flogisoft.com/bash/tip_colors_and_formatting
121
+ # 39: default for the theme
122
+ # 33: yellow
123
+ # 31: red
124
+ # 37: light gray
120
125
  SEVERITY_TO_COLOR_MAP = {
121
- DEBUG => '0;37', INFO => '0;37', WARN => '33',
122
- ERROR => '31', FATAL => '31', UNKNOWN => '37'
123
- }
124
-
126
+ DEBUG => '39'.freeze,
127
+ INFO => DEBUG,
128
+ WARN => '33'.freeze,
129
+ ERROR => '31'.freeze,
130
+ FATAL => ERROR,
131
+ UNKNOWN => '37'.freeze
132
+ }.freeze
133
+
134
+ # \e[colorm sets a color \e[0m resets all properties
125
135
  def log_data(severity, message)
126
136
  color = SEVERITY_TO_COLOR_MAP[severity]
127
- @iodevice.write("\033[#{color}m#{message}\033[0m\n")
137
+ @iodevice.write("\e[#{color}m#{message}\e[0m\n")
128
138
  end
129
139
  end
130
140
 
@@ -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.2.1'
4
+ VERSION = '1.3.0'.freeze
5
5
  end
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.2.1
4
+ version: 1.3.0
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-01-26 00:00:00.000000000 Z
11
+ date: 2016-02-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: oj
@@ -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.4.8
169
+ rubygems_version: 2.5.1
170
170
  signing_key:
171
171
  specification_version: 4
172
172
  summary: Very fast JSON logger