ougai 1.5.7 → 1.5.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/ougai/formatters/base.rb +9 -0
- data/lib/ougai/formatters/bunyan.rb +1 -1
- data/lib/ougai/formatters/readable.rb +1 -1
- data/lib/ougai/version.rb +1 -1
- metadata +8 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a588e40241e44170e894aae8b996ccc82375645f
|
4
|
+
data.tar.gz: aca283dc2cd06a235d18ac64c3e837fbd11067e3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6fc74083126a0500526eaad7cee67ffc1b6a8819a547d3b30239f01f0a49f1333ffb9405cea7c68cd2ef606a0d0853613c159382f2b8cb08120a1465e09b3e73
|
7
|
+
data.tar.gz: ab58e1af3d71ffa0f2ae74f3fc976a1487f4785c8e5858cca19b835b600fe8a4c47b9b2b64a076d090393e40b6b6a0ba392f9e1f67bf70aa2dd9e48c114c9384
|
@@ -4,6 +4,7 @@ require 'socket'
|
|
4
4
|
module Ougai
|
5
5
|
module Formatters
|
6
6
|
# Base formatter
|
7
|
+
# Custom formatter must override `_call`.
|
7
8
|
# @attr [Fixnum] trace_indent Specify exception backtrace indent (by default this is 2).
|
8
9
|
# @attr [Fixnum] trace_max_lines Keep exception backtrace lines (by default this is 100).
|
9
10
|
# @attr [Boolean] serialize_backtrace Whether exception should converts String (by default this is on).
|
@@ -21,6 +22,14 @@ module Ougai
|
|
21
22
|
self.datetime_format = nil
|
22
23
|
end
|
23
24
|
|
25
|
+
def call(severity, time, progname, data)
|
26
|
+
_call(severity, time, progname, data.is_a?(Hash) ? data : { msg: data.to_s })
|
27
|
+
end
|
28
|
+
|
29
|
+
def _call(severity, time, progname, data)
|
30
|
+
raise NotImplementedError, "_call must be implemented"
|
31
|
+
end
|
32
|
+
|
24
33
|
def datetime_format=(value)
|
25
34
|
@datetime_format = value || default_datetime_format
|
26
35
|
end
|
data/lib/ougai/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ougai
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.5.
|
4
|
+
version: 1.5.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Toshimitsu Takahashi
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-12-
|
11
|
+
date: 2017-12-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -103,17 +103,17 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
103
103
|
version: '0'
|
104
104
|
requirements: []
|
105
105
|
rubyforge_project:
|
106
|
-
rubygems_version: 2.6.
|
106
|
+
rubygems_version: 2.6.11
|
107
107
|
signing_key:
|
108
108
|
specification_version: 4
|
109
109
|
summary: JSON logger compatible with node-bunyan is capable of handling structured
|
110
110
|
data easily.
|
111
111
|
test_files:
|
112
|
-
- spec/
|
113
|
-
- spec/formatters/bunyan_spec.rb
|
114
|
-
- spec/formatters/readable_spec.rb
|
112
|
+
- spec/spec_helper.rb
|
115
113
|
- spec/child_logger_spec.rb
|
116
|
-
- spec/logging_spec.rb
|
117
114
|
- spec/logger_spec.rb
|
118
115
|
- spec/ougai_spec.rb
|
119
|
-
- spec/
|
116
|
+
- spec/formatters/readable_spec.rb
|
117
|
+
- spec/formatters/bunyan_spec.rb
|
118
|
+
- spec/formatters/base_spec.rb
|
119
|
+
- spec/logging_spec.rb
|