logger 1.4.3 → 1.5.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/logger/formatter.rb +3 -2
- data/lib/logger/log_device.rb +1 -1
- data/lib/logger/version.rb +1 -1
- data/lib/logger.rb +6 -5
- data/logger.gemspec +0 -2
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 55dfc9db8783f8e0bce997c8f6c162b10e4602bcbe968354bb8f4a0f3a6c1764
|
4
|
+
data.tar.gz: '08e336951520fc4cc5ab2553ec563509a769a20fb461f47d4e0f2b561745783e'
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 001ea8a77429868cfe3e438b41a1d100ee0d5c1bba2d74685fd031add97efae2bb0f31b4d889a84a954f01dfcc96624512e488bb08da4703e33bc38432c3e606
|
7
|
+
data.tar.gz: 747d62f6bf313cb3a120afcae4179feb47bbe816d40895793ccc719ca87bb4c1798c0cb72ac39862dbcbacc6468e59606d2d5600e395607562f0c0a58bbf3f6f
|
data/lib/logger/formatter.rb
CHANGED
@@ -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 ||
|
23
|
+
time.strftime(@datetime_format || DatetimeFormat)
|
23
24
|
end
|
24
25
|
|
25
26
|
def msg2str(msg)
|
data/lib/logger/log_device.rb
CHANGED
data/lib/logger/version.rb
CHANGED
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+
|
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+
|
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+
|
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+
|
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+
|
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
|
+
version: 1.5.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Naotoshi Seo
|
8
8
|
- SHIBATA Hiroshi
|
9
9
|
autorequire:
|
10
|
-
bindir:
|
10
|
+
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
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.
|
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.
|