trivial_log_formatter 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/trivial_log_formatter.rb +8 -2
- data/lib/trivial_log_formatter/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: b2bc3bea213041b469b757ffe0e2504f97c9f179
|
4
|
+
data.tar.gz: e864321098959873c9671e8460eef066debb64ca
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 75b37ab9de4605a7047d9de7f5f87431942031a7bdac2f7fda3b4211047cd6a7fd4fa6919e92d5b5add3d016b220a3f1c435e6e6e6e8cbf2413728dbccc98834
|
7
|
+
data.tar.gz: e7d26a9d1f4beedbc5ab05827283f8f7cd023d939c556fd0ffcb9bd498b176699f1f7041b292fc344290533f6d4e8ee3b9e7ff8a293ec4149f4f120819bdcd0c
|
data/Gemfile.lock
CHANGED
@@ -4,10 +4,16 @@ require 'logger'
|
|
4
4
|
module TrivialLogFormatter
|
5
5
|
|
6
6
|
class Formatter < ::Logger::Formatter
|
7
|
-
FORMAT = "[%s#%d] %5s -- %s: %s\n"
|
7
|
+
FORMAT = "\033[%sm[%s#%d] %5s -- %s: %s\033[0m\n"
|
8
|
+
SEVERITY_COLOR_MAP = {:debug => '0;37', :info => '32', :warn => '33', :error => '31', :fatal => '31', :unknown => '37'}
|
8
9
|
|
9
10
|
def call(severity, time, progname, msg)
|
10
|
-
|
11
|
+
msg = '' if msg.nil?
|
12
|
+
FORMAT % [severity_to_color(severity), format_datetime(time), $$, severity, progname, msg2str(msg)]
|
13
|
+
end
|
14
|
+
|
15
|
+
def severity_to_color(severity)
|
16
|
+
SEVERITY_COLOR_MAP[severity.downcase.to_sym]
|
11
17
|
end
|
12
18
|
|
13
19
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: trivial_log_formatter
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Erich N. Quintero
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-09-25 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: Based on Ruby's default formatter.
|
14
14
|
email: contact@quintsys.com
|
@@ -48,7 +48,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
48
48
|
version: '0'
|
49
49
|
requirements: []
|
50
50
|
rubyforge_project:
|
51
|
-
rubygems_version: 2.
|
51
|
+
rubygems_version: 2.4.1
|
52
52
|
signing_key:
|
53
53
|
specification_version: 4
|
54
54
|
summary: Trivial log formatter.
|