loggerx 0.3.4 → 0.3.6

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: 618517da50647ce9e4961b0d6bbfab37bce4179661403664b23a2832da37ca5b
4
- data.tar.gz: c93ade4b5ff8a52d8ca77b3264dc0bef3bb0b168b53b6a07efaa575737ae9fac
3
+ metadata.gz: 3940a998f7539a4e361b9e8500133ff929bc941bf3ecaab4338a78b7c455dfc8
4
+ data.tar.gz: 2ffd905adc8f8109448f78db6d17531ab68ecc81b838d3fbfe832960fd485573
5
5
  SHA512:
6
- metadata.gz: 652c43e5a99523f117322b2da7b6f2e3adb76d98fb17ad01cd7e6011c883bc87a78ef01945d34dc842a53f1b5a9bc7caf712580300c3109a17a7b0c697a106f5
7
- data.tar.gz: 982c8a7b997d32bcfd713d356b844f71c2aba0b204ddadc0863b4a51b8bb738b504f61e8c297a30eb06c9d1173ae6cf282c2565c0db92d6d4c8bb6825fda411d
6
+ metadata.gz: 0fdef43d7f1372742df2a745c8ca4ecac85426af19493bf6546fd0b3d5bb55da05fab80a78cf57459a9bd6ac0ebdc0335b610434507ce9c372832a36ffcaa1e2
7
+ data.tar.gz: 3fad2a62b451b2943f923665766632b32449d90c0ebf2b97cc85ff3be61ca2056b011806579a1665a2bc658d0ae640183c56dbbbddda8fe1dc6df463504de577
@@ -94,8 +94,8 @@ module Loggerx
94
94
  end
95
95
 
96
96
  def register_log_level(log_level)
97
- @log_file.level = log_level
98
- @log_stdout.level = log_level
97
+ @log_file&.level = log_level
98
+ @log_stdout&.level = log_level
99
99
  #
100
100
  # Log4r互換インターフェイス
101
101
  # DEBUG < INFO < WARN < ERROR < FATAL < UNKNOWN
@@ -42,7 +42,7 @@ module Loggerx
42
42
  list[0, latest_index].map(&:unlink) if latest_index.positive?
43
43
  end
44
44
 
45
- def init(prefix, fname, log_dir, stdout_flag, level = :info)
45
+ def init(prefix, fname, log_dir, stdout_flag, level: :info)
46
46
  return if @log_file
47
47
 
48
48
  @error_count = 0
@@ -55,6 +55,11 @@ module Loggerx
55
55
  unknown: Logger::UNKNOWN
56
56
  }
57
57
  @log_level = level_hs[level]
58
+ if @log_level.nil?
59
+ p "level=#{level} level.class=#{level.class}"
60
+ return unless @log_level
61
+ end
62
+
58
63
  @log_dir_pn = Pathname.new(log_dir)
59
64
 
60
65
  @limit_of_num_of_files ||= 5
@@ -116,9 +121,8 @@ module Loggerx
116
121
  end
117
122
 
118
123
  def register_log_level(log_level)
119
- {log_level.class} ==========="
120
- # @log_file&.level = log_level
121
- # @log_stdout&.level = log_level
124
+ @log_file&.level = log_level
125
+ @log_stdout&.level = log_level
122
126
  #
123
127
  # Log4r互換インターフェイス
124
128
  # DEBUG < INFO < WARN < ERROR < FATAL < UNKNOWN
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Loggerx
4
- VERSION = '0.3.4'
4
+ VERSION = '0.3.6'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: loggerx
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.4
4
+ version: 0.3.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - ykominami