mono_logger 1.1.1 → 1.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/build.yml +3 -0
- data/Gemfile +0 -1
- data/README.md +1 -1
- data/lib/mono_logger/version.rb +1 -1
- data/lib/mono_logger.rb +2 -5
- data/test/mri_logger_test.rb +6 -12
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 823f37da856af8b746e568ef27edab8caa15fd5130311f31617840bfdc80b8f4
|
4
|
+
data.tar.gz: 77608e001c19214270877f209f4b791ae65d83aba0f1d02925c57f57d535610f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d0dd2a78c38a20f444a4bfcfe6702f7a8ab61e14e93fa404de64888d8457e5e8ed6c5e1131f279c2243f803fc82be473cd4c25723af758d9decb1288d379626a
|
7
|
+
data.tar.gz: 5744a0a832cd33cf50fd8ebf13a032daf9b32b7f005323120953b4c1d8e0f201e57de3848ba1cfa037aa49d9dcca7adc66296cd5de5297eebaf5299b43e7262a
|
data/.github/workflows/build.yml
CHANGED
data/Gemfile
CHANGED
data/README.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# MonoLogger
|
2
2
|
|
3
|
-
[![Build Status](https://travis-ci.org/steveklabnik/mono_logger.png?branch=master)](https://travis-ci.org/steveklabnik/mono_logger) [![Code Climate](https://codeclimate.com/github/steveklabnik/mono_logger.png)](https://codeclimate.com/github/steveklabnik/mono_logger)
|
3
|
+
[![Build Status](https://travis-ci.org/steveklabnik/mono_logger.png?branch=master)](https://travis-ci.org/steveklabnik/mono_logger) [![Code Climate](https://codeclimate.com/github/steveklabnik/mono_logger.png)](https://codeclimate.com/github/steveklabnik/mono_logger)
|
4
4
|
|
5
5
|
Ruby's stdlib Logger wraps all IO in mutexes. Ruby 2.0 doesn't allow you to
|
6
6
|
request a lock in a trap handler because that could deadlock. This gem fixes
|
data/lib/mono_logger/version.rb
CHANGED
data/lib/mono_logger.rb
CHANGED
@@ -28,11 +28,8 @@ class MonoLogger < Logger
|
|
28
28
|
# Create an instance.
|
29
29
|
#
|
30
30
|
def initialize(logdev, shift_age=nil, shift_size=nil)
|
31
|
-
|
32
|
-
|
33
|
-
@default_formatter = Formatter.new
|
34
|
-
@formatter = nil
|
35
|
-
@logdev = nil
|
31
|
+
super(nil)
|
32
|
+
|
36
33
|
if logdev
|
37
34
|
@logdev = LocklessLogDevice.new(logdev)
|
38
35
|
end
|
data/test/mri_logger_test.rb
CHANGED
@@ -1,13 +1,4 @@
|
|
1
1
|
# coding: US-ASCII
|
2
|
-
require 'simplecov'
|
3
|
-
SimpleCov.start do
|
4
|
-
add_filter do |source_file|
|
5
|
-
source_file.filename =~ /test/
|
6
|
-
end
|
7
|
-
end
|
8
|
-
|
9
|
-
require 'coveralls'
|
10
|
-
Coveralls.wear!
|
11
2
|
|
12
3
|
require 'minitest/autorun'
|
13
4
|
require 'mono_logger'
|
@@ -112,16 +103,19 @@ class TestLogger < Minitest::Test
|
|
112
103
|
end
|
113
104
|
|
114
105
|
def test_datetime_format
|
106
|
+
# We use strip because we don't care about the upstream changes that
|
107
|
+
# happened to whitespace, and this makes the test behave the same
|
108
|
+
# regardless of Ruby/Logger version.
|
115
109
|
dummy = STDERR
|
116
110
|
logger = Logger.new(dummy)
|
117
111
|
log = log_add(logger, INFO, "foo")
|
118
|
-
assert_match(/^\d\d\d\d-\d\d-\d\dT\d\d:\d\d:\d\d.\s*\d
|
112
|
+
assert_match(/^\d\d\d\d-\d\d-\d\dT\d\d:\d\d:\d\d.\s*\d+$/, log.datetime.strip)
|
119
113
|
logger.datetime_format = "%d%b%Y@%H:%M:%S"
|
120
114
|
log = log_add(logger, INFO, "foo")
|
121
|
-
assert_match(/^\d\d\w\w\w\d\d\d\d@\d\d:\d\d:\d\d$/, log.datetime)
|
115
|
+
assert_match(/^\d\d\w\w\w\d\d\d\d@\d\d:\d\d:\d\d$/, log.datetime.strip)
|
122
116
|
logger.datetime_format = ""
|
123
117
|
log = log_add(logger, INFO, "foo")
|
124
|
-
assert_match(/^$/, log.datetime)
|
118
|
+
assert_match(/^$/, log.datetime.strip)
|
125
119
|
end
|
126
120
|
|
127
121
|
def test_formatter
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mono_logger
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Steve Klabnik
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2023-04-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|