lorekeeper 1.2.1 → 1.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +4 -2
- data/CHANGELOG.md +5 -0
- data/lib/lorekeeper/json_logger.rb +17 -7
- data/lib/lorekeeper/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3c57e4384fccde817a60496b1a82d00b5c6f5c30
|
4
|
+
data.tar.gz: c68a007d458b589ab9d4db7a3da87025774df172
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4ddebaffb6c6ccaab8c5cc70d2d51e300577d928729fc022322cb6ddbf6deda9fdecf12d9cdc2f0851d8935871481252ab27a9791eda94778b4775f6d7d4f8f5
|
7
|
+
data.tar.gz: 5c90023c007a07e9796c16abdeb85fba5f467a454c29bf8e5c2932c848192b7e0dddd838dc0b6ac0da67181901e8eb152b6a34dfb0e7e64b3ad9b48c7e7fb2bd
|
data/.travis.yml
CHANGED
data/CHANGELOG.md
CHANGED
@@ -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.%
|
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)
|
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 => '
|
122
|
-
|
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("\
|
137
|
+
@iodevice.write("\e[#{color}m#{message}\e[0m\n")
|
128
138
|
end
|
129
139
|
end
|
130
140
|
|
data/lib/lorekeeper/version.rb
CHANGED
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.
|
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-
|
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.
|
169
|
+
rubygems_version: 2.5.1
|
170
170
|
signing_key:
|
171
171
|
specification_version: 4
|
172
172
|
summary: Very fast JSON logger
|