logger 1.5.2 → 1.5.3

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: b70d947261ec2e9d94145b13c4831a54fa6c49864aa208e63d4151fd494de443
4
- data.tar.gz: cda09e37794e00a0c56e66e7ade628f2acdf10312af790d0e2fd1d5c32bf30f1
3
+ metadata.gz: 299d68259bad0228e1e6519f73ddbef94902a8e04f230ad8bbc38f1cb7c45dee
4
+ data.tar.gz: 9178b4b52d2e025fefb9dcadebd94ff6a95392d5d381b949f8d2cb454d456bab
5
5
  SHA512:
6
- metadata.gz: b26008735ad28617a11e8db99db0c5aa5abd5253f3950182da45d342d2bf360d6ef48da6cf1a87c11282ff242f59ee4b731093cb6e738b0464f2a78ceb4df7d1
7
- data.tar.gz: 5aba8135b1e8322f1038b5bdff1d5ff7472edc3aa71a88f8798e944ea0fb1fad4884c2e6281c9e0691ded78fc9cf0ae75cf6a1d56b3fa23c33fc5e90b30aaa4e
6
+ metadata.gz: 1ee506486c7af0e574c4c4c58b28ca10c2d0d4a0493d0b405e43af96e93bb0c397dee7b128d0d89e7793724b6f0cb186c8e2d33aa2ff8cfc6e847e830e6c0127
7
+ data.tar.gz: 70c4a17f55e4eb5d2323ef5218151de9638a70b8690f6a40180b051554a17bd58b4a09521bbc8ca6a55b60afc9215d51b1c37873c0883e5ba3f42d89e4965a36
@@ -3,7 +3,7 @@
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 = "%.1s, [%s #%d] %5s -- %s: %s\n"
7
7
  DatetimeFormat = "%Y-%m-%dT%H:%M:%S.%6N"
8
8
 
9
9
  attr_accessor :datetime_format
@@ -13,8 +13,7 @@ class Logger
13
13
  end
14
14
 
15
15
  def call(severity, time, progname, msg)
16
- Format % [severity[0, 1], format_datetime(time), Process.pid, severity, progname,
17
- msg2str(msg)]
16
+ sprintf(Format, severity, format_datetime(time), Process.pid, severity, progname, msg2str(msg))
18
17
  end
19
18
 
20
19
  private
@@ -79,8 +79,10 @@ class Logger
79
79
  def set_dev(log)
80
80
  if log.respond_to?(:write) and log.respond_to?(:close)
81
81
  @dev = log
82
- if log.respond_to?(:path)
83
- @filename = log.path
82
+ if log.respond_to?(:path) and path = log.path
83
+ if File.exist?(path)
84
+ @filename = path
85
+ end
84
86
  end
85
87
  else
86
88
  @dev = open_logfile(log)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  class Logger
4
- VERSION = "1.5.2"
4
+ VERSION = "1.5.3"
5
5
  end
data/logger.gemspec CHANGED
@@ -23,5 +23,4 @@ Gem::Specification.new do |spec|
23
23
  spec.add_development_dependency "bundler", ">= 0"
24
24
  spec.add_development_dependency "rake", ">= 12.3.3"
25
25
  spec.add_development_dependency "test-unit"
26
- spec.add_development_dependency "rdoc"
27
26
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: logger
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.5.2
4
+ version: 1.5.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Naotoshi Seo
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2022-12-05 00:00:00.000000000 Z
12
+ date: 2022-12-16 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler
@@ -53,20 +53,6 @@ dependencies:
53
53
  - - ">="
54
54
  - !ruby/object:Gem::Version
55
55
  version: '0'
56
- - !ruby/object:Gem::Dependency
57
- name: rdoc
58
- requirement: !ruby/object:Gem::Requirement
59
- requirements:
60
- - - ">="
61
- - !ruby/object:Gem::Version
62
- version: '0'
63
- type: :development
64
- prerelease: false
65
- version_requirements: !ruby/object:Gem::Requirement
66
- requirements:
67
- - - ">="
68
- - !ruby/object:Gem::Version
69
- version: '0'
70
56
  description: Provides a simple logging utility for outputting messages.
71
57
  email:
72
58
  - sonots@gmail.com
@@ -103,7 +89,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
103
89
  - !ruby/object:Gem::Version
104
90
  version: '0'
105
91
  requirements: []
106
- rubygems_version: 3.4.0.dev
92
+ rubygems_version: 3.3.26
107
93
  signing_key:
108
94
  specification_version: 4
109
95
  summary: Provides a simple logging utility for outputting messages.