logger 1.4.3 → 1.5.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: be49be41055335fa90e79c26a714b7176077de04b414def791b1a9524169ad80
4
- data.tar.gz: f064246f7c9e483f96e9838ace1d079ce0d9acea770eb68d5a492a792157bb83
3
+ metadata.gz: 55dfc9db8783f8e0bce997c8f6c162b10e4602bcbe968354bb8f4a0f3a6c1764
4
+ data.tar.gz: '08e336951520fc4cc5ab2553ec563509a769a20fb461f47d4e0f2b561745783e'
5
5
  SHA512:
6
- metadata.gz: 8dc3387289106d3f98eda8384351d9486b8ad5bb21e5c58a3932595b101705600b1b66c64666eabab90a11f1d90a4b7f01e6f0ce658249bfb9ede51d76414ef4
7
- data.tar.gz: 693e411b78fc95e47d008b3ced6247606ebb641f7a17368321e8e0002fa450694267794a620fc76f949ac9cf2a7e5ac8b891416d7d4accb738f8c2c228421388
6
+ metadata.gz: 001ea8a77429868cfe3e438b41a1d100ee0d5c1bba2d74685fd031add97efae2bb0f31b4d889a84a954f01dfcc96624512e488bb08da4703e33bc38432c3e606
7
+ data.tar.gz: 747d62f6bf313cb3a120afcae4179feb47bbe816d40895793ccc719ca87bb4c1798c0cb72ac39862dbcbacc6468e59606d2d5600e395607562f0c0a58bbf3f6f
@@ -3,7 +3,8 @@
3
3
  class Logger
4
4
  # Default formatter for log messages.
5
5
  class Formatter
6
- Format = "%s, [%s#%d] %5s -- %s: %s\n"
6
+ Format = "%s, [%s #%d] %5s -- %s: %s\n"
7
+ DatetimeFormat = "%Y-%m-%dT%H:%M:%S.%6N"
7
8
 
8
9
  attr_accessor :datetime_format
9
10
 
@@ -19,7 +20,7 @@ class Logger
19
20
  private
20
21
 
21
22
  def format_datetime(time)
22
- time.strftime(@datetime_format || "%Y-%m-%dT%H:%M:%S.%6N ")
23
+ time.strftime(@datetime_format || DatetimeFormat)
23
24
  end
24
25
 
25
26
  def msg2str(msg)
@@ -135,7 +135,7 @@ class Logger
135
135
  end
136
136
  end
137
137
 
138
- if /mswin|mingw|cygwin/ =~ RUBY_PLATFORM
138
+ if /mswin|mingw|cygwin/ =~ RbConfig::CONFIG['host_os']
139
139
  def lock_shift_log
140
140
  yield
141
141
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  class Logger
4
- VERSION = "1.4.3"
4
+ VERSION = "1.5.1"
5
5
  end
data/lib/logger.rb CHANGED
@@ -11,6 +11,7 @@
11
11
  # A simple system for logging messages. See Logger for more documentation.
12
12
 
13
13
  require 'monitor'
14
+ require 'rbconfig'
14
15
 
15
16
  require_relative 'logger/version'
16
17
  require_relative 'logger/formatter'
@@ -302,35 +303,35 @@ class Logger
302
303
  alias sev_threshold level
303
304
  alias sev_threshold= level=
304
305
 
305
- # Returns +true+ iff the current severity level allows for the printing of
306
+ # Returns +true+ if and only if the current severity level allows for the printing of
306
307
  # +DEBUG+ messages.
307
308
  def debug?; level <= DEBUG; end
308
309
 
309
310
  # Sets the severity to DEBUG.
310
311
  def debug!; self.level = DEBUG; end
311
312
 
312
- # Returns +true+ iff the current severity level allows for the printing of
313
+ # Returns +true+ if and only if the current severity level allows for the printing of
313
314
  # +INFO+ messages.
314
315
  def info?; level <= INFO; end
315
316
 
316
317
  # Sets the severity to INFO.
317
318
  def info!; self.level = INFO; end
318
319
 
319
- # Returns +true+ iff the current severity level allows for the printing of
320
+ # Returns +true+ if and only if the current severity level allows for the printing of
320
321
  # +WARN+ messages.
321
322
  def warn?; level <= WARN; end
322
323
 
323
324
  # Sets the severity to WARN.
324
325
  def warn!; self.level = WARN; end
325
326
 
326
- # Returns +true+ iff the current severity level allows for the printing of
327
+ # Returns +true+ if and only if the current severity level allows for the printing of
327
328
  # +ERROR+ messages.
328
329
  def error?; level <= ERROR; end
329
330
 
330
331
  # Sets the severity to ERROR.
331
332
  def error!; self.level = ERROR; end
332
333
 
333
- # Returns +true+ iff the current severity level allows for the printing of
334
+ # Returns +true+ if and only if the current severity level allows for the printing of
334
335
  # +FATAL+ messages.
335
336
  def fatal?; level <= FATAL; end
336
337
 
data/logger.gemspec CHANGED
@@ -16,8 +16,6 @@ Gem::Specification.new do |spec|
16
16
  spec.licenses = ["Ruby", "BSD-2-Clause"]
17
17
 
18
18
  spec.files = Dir.glob("lib/**/*.rb") + ["logger.gemspec"]
19
- spec.bindir = "exe"
20
- spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
21
19
  spec.require_paths = ["lib"]
22
20
 
23
21
  spec.required_ruby_version = ">= 2.3.0"
metadata CHANGED
@@ -1,15 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: logger
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.4.3
4
+ version: 1.5.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Naotoshi Seo
8
8
  - SHIBATA Hiroshi
9
9
  autorequire:
10
- bindir: exe
10
+ bindir: bin
11
11
  cert_chain: []
12
- date: 2020-12-22 00:00:00.000000000 Z
12
+ date: 2022-03-17 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler
@@ -103,7 +103,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
103
103
  - !ruby/object:Gem::Version
104
104
  version: '0'
105
105
  requirements: []
106
- rubygems_version: 3.2.2
106
+ rubygems_version: 3.4.0.dev
107
107
  signing_key:
108
108
  specification_version: 4
109
109
  summary: Provides a simple logging utility for outputting messages.