uu 0.2.1 → 0.2.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +3 -3
- data/lib/uu/logger_stderr.rb +18 -11
- data/lib/uu/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 14e1e3bf983702c4482517b7e01bd949137b9bd6c3ac9ec8b98e44115554384f
|
4
|
+
data.tar.gz: fdaa6b2c59fdd914b619ca25be38b461b6d32fca643a060dae4c78d186b0459a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e8fc6f3aa6358952c58841d8fd7d421f32801a57fdf048735fff98688e8857d803088db17f9d60024b57237237611458dd35e28e00e70e0640bdb4693a8e5255
|
7
|
+
data.tar.gz: 21365178ae087e6f1b2e793b9e8b59b2609adc1c58aed2d4aaf936184fab5c5f582c2f66edf30b00dc314c11e4ba36731be5d17bbeed2581235818738388b693
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
uu (0.2.
|
4
|
+
uu (0.2.2)
|
5
5
|
colorize
|
6
6
|
fluent-logger
|
7
7
|
|
@@ -15,7 +15,7 @@ GEM
|
|
15
15
|
diff-lcs (1.3)
|
16
16
|
dotenv (2.6.0)
|
17
17
|
ffi (1.10.0)
|
18
|
-
fluent-logger (0.
|
18
|
+
fluent-logger (0.8.0)
|
19
19
|
msgpack (>= 1.0.0, < 2)
|
20
20
|
formatador (0.2.5)
|
21
21
|
guard (2.15.0)
|
@@ -120,4 +120,4 @@ DEPENDENCIES
|
|
120
120
|
yard
|
121
121
|
|
122
122
|
BUNDLED WITH
|
123
|
-
|
123
|
+
2.0.1
|
data/lib/uu/logger_stderr.rb
CHANGED
@@ -7,15 +7,6 @@ require 'json'
|
|
7
7
|
module UU
|
8
8
|
class LoggerStderr < Logger
|
9
9
|
class Formatter
|
10
|
-
DECORATION = {
|
11
|
-
'UNKNOWN' => { color: :red, mode: :underline },
|
12
|
-
'FATAL' => { color: :red, mode: :underline },
|
13
|
-
'ERROR' => :red,
|
14
|
-
'WARN' => :yellow,
|
15
|
-
'INFO' => :default,
|
16
|
-
'DEBUG' => :light_black,
|
17
|
-
}.freeze
|
18
|
-
|
19
10
|
def initialize(context)
|
20
11
|
@context = context
|
21
12
|
end
|
@@ -32,7 +23,7 @@ module UU
|
|
32
23
|
"#{short_severity}]#{time_format}" \
|
33
24
|
"[#{loc[:filename]}##{loc[:method]}:#{loc[:lineno]}] " \
|
34
25
|
"#{context_msg}" \
|
35
|
-
"#{msg}\n"
|
26
|
+
"#{msg}\n"
|
36
27
|
end
|
37
28
|
|
38
29
|
def meaningful_location
|
@@ -59,8 +50,24 @@ module UU
|
|
59
50
|
end
|
60
51
|
end
|
61
52
|
|
53
|
+
class FormatterColor < Formatter
|
54
|
+
DECORATION = {
|
55
|
+
'UNKNOWN' => { color: :red, mode: :underline },
|
56
|
+
'FATAL' => { color: :red, mode: :underline },
|
57
|
+
'ERROR' => :red,
|
58
|
+
'WARN' => :yellow,
|
59
|
+
'INFO' => :default,
|
60
|
+
'DEBUG' => :light_black,
|
61
|
+
}.freeze
|
62
|
+
|
63
|
+
def call(severity, time, _progname, msg)
|
64
|
+
super.colorize(DECORATION[severity])
|
65
|
+
end
|
66
|
+
end
|
67
|
+
|
62
68
|
def initialize(context)
|
63
|
-
|
69
|
+
formatter = $stderr.tty? ? FormatterColor : Formatter
|
70
|
+
super($stderr, formatter: formatter.new(context))
|
64
71
|
end
|
65
72
|
end
|
66
73
|
end
|
data/lib/uu/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: uu
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Minwoo Lee
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
11
|
+
date: 2019-02-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: colorize
|