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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3701342a891450befe67513434dbd187c2300563939717971ccf9f5cd8db7477
4
- data.tar.gz: db83a143f6ea69bbbe49c193b841bf6ec4654a4eab2466883f1d1a8fe0a20558
3
+ metadata.gz: 7e8425c5c0e962f2a2e4a9d60d8e36c545d16c94c93f4c7a35059f13f6644b1a
4
+ data.tar.gz: 5a9cd41cb837ae50d22d08bb409cb77844ab8a105503b5203c96c1f56e1dce35
5
5
  SHA512:
6
- metadata.gz: 1516fb68602f9f241f0a1d8513b0aacb76c7c185793fe8996e158c8f0b220cf84a7bc847496d5b68975c6b72b1eb0929a6a2c4f43eddda93618f2eceecab5426
7
- data.tar.gz: 8f512efdcb640b18701f66d7e0fcb08f2d5b7038e64a20b29cf7d8f90b852554c986ed3030235daaff95e10c253f56a518b11bc18adf628e19daf23c44e5c79c
6
+ metadata.gz: c80780a263df96fe7edb480a25bcf1ea78c16b9f00087184a0483c00c2125d73be8f3d69ebfa06577718a3d2472e7ba48be32deca856066c3fd009e11a64e5ed
7
+ data.tar.gz: ec534f16743c6cdfeae02261d2e99a4b8f68e0edf8568e85401115dee54e7a4135b624f908dc91613ab58a8c909ac028cee52388905c17ec7ad0ce38c6d1d251
@@ -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
- register('file', @original_config['stdout'] ? $stdout : @original_config['file'] || 'application.log')
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
- logger = ::Logger.new(
43
- resource('file'),
44
- resource('rotate_days'),
45
- resource('rotate_size')
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')
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Kybus
4
4
  module Logger
5
- VERSION = '0.2.3'
5
+ VERSION = '0.3.0'
6
6
  end
7
7
  end
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.2.3
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: 2022-11-17 00:00:00.000000000 Z
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.3.7
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