kybus-logger 0.2.3 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/kybus/logger/config.rb +16 -7
- data/lib/kybus/logger/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7e8425c5c0e962f2a2e4a9d60d8e36c545d16c94c93f4c7a35059f13f6644b1a
|
4
|
+
data.tar.gz: 5a9cd41cb837ae50d22d08bb409cb77844ab8a105503b5203c96c1f56e1dce35
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c80780a263df96fe7edb480a25bcf1ea78c16b9f00087184a0483c00c2125d73be8f3d69ebfa06577718a3d2472e7ba48be32deca856066c3fd009e11a64e5ed
|
7
|
+
data.tar.gz: ec534f16743c6cdfeae02261d2e99a4b8f68e0edf8568e85401115dee54e7a4135b624f908dc91613ab58a8c909ac028cee52388905c17ec7ad0ce38c6d1d251
|
data/lib/kybus/logger/config.rb
CHANGED
@@ -1,7 +1,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
require 'logger'
|
4
|
-
|
5
4
|
require_relative 'format'
|
6
5
|
|
7
6
|
module Kybus
|
@@ -22,7 +21,12 @@ module Kybus
|
|
22
21
|
end
|
23
22
|
|
24
23
|
def init_log_file
|
25
|
-
|
24
|
+
log_output = if @original_config['stdout'].nil? || @original_config['stdout']
|
25
|
+
$stdout
|
26
|
+
else
|
27
|
+
@original_config['file'] || 'application.log'
|
28
|
+
end
|
29
|
+
register('file', log_output)
|
26
30
|
register('rotate_days', @original_config['rotate_days'] || 7)
|
27
31
|
register('rotate_size', @original_config['rotate_size'] || (100 * (1024**2))) # 100Mb
|
28
32
|
end
|
@@ -39,11 +43,16 @@ module Kybus
|
|
39
43
|
|
40
44
|
def logger
|
41
45
|
@logger ||= begin
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
46
|
+
log_output = resource('file')
|
47
|
+
logger = if log_output == $stdout
|
48
|
+
::Logger.new(log_output)
|
49
|
+
else
|
50
|
+
::Logger.new(
|
51
|
+
log_output,
|
52
|
+
resource('rotate_days'),
|
53
|
+
resource('rotate_size')
|
54
|
+
)
|
55
|
+
end
|
47
56
|
$stdout.sync = true if @original_config['stdout']
|
48
57
|
logger.sev_threshold = SEVERITIES[resource('severity')]
|
49
58
|
logger.datetime_format = resource('date_format')
|
data/lib/kybus/logger/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: kybus-logger
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Gilberto Vargas
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2024-07-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: kybus-core
|
@@ -141,7 +141,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
141
141
|
- !ruby/object:Gem::Version
|
142
142
|
version: '0'
|
143
143
|
requirements: []
|
144
|
-
rubygems_version: 3.
|
144
|
+
rubygems_version: 3.5.14
|
145
145
|
signing_key:
|
146
146
|
specification_version: 4
|
147
147
|
summary: Implements a kybus-logger with a format based on cute_logger
|