scrolls 0.3.8 → 0.3.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/scrolls/iolog.rb +12 -0
- data/lib/scrolls/log.rb +4 -16
- data/lib/scrolls/syslog.rb +1 -1
- data/lib/scrolls/version.rb +1 -1
- data/test/test_scrolls.rb +8 -2
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 764cf377dd151093b60740032200866af5dfe033
|
4
|
+
data.tar.gz: ad73c8e48a7baa90366ca0e1a05eea887f719fb3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 43df84fb536e8f94aa15e99471def2587ad5a8abe73ba018392d4aa9deacfff21eb1d2fbc11458670f43d459fe7a3cedeb190436bd5d93a997f7f2374fd35383
|
7
|
+
data.tar.gz: d565408e3abf2d46ce1f0561e9dbee59003f5041bbec07a0bdae3cd099295ec9cbf77c3bd8f2df97b1b15b797c1c7d452c1099df2d59ae53b444cb49e5c32424
|
data/lib/scrolls/log.rb
CHANGED
@@ -1,5 +1,6 @@
|
|
1
1
|
require "scrolls/parser"
|
2
2
|
require "scrolls/utils"
|
3
|
+
require "scrolls/iolog"
|
3
4
|
require "scrolls/syslog"
|
4
5
|
|
5
6
|
module Scrolls
|
@@ -231,27 +232,14 @@ module Scrolls
|
|
231
232
|
((finish - start).to_f * @t)
|
232
233
|
end
|
233
234
|
|
234
|
-
def
|
235
|
-
|
236
|
-
end
|
237
|
-
|
238
|
-
def sync_stream(out=nil)
|
239
|
-
out = STDOUT if out.nil?
|
240
|
-
s = out
|
241
|
-
s.sync = true
|
242
|
-
s
|
235
|
+
def sync_stream(out = STDOUT)
|
236
|
+
IOLog.new(out)
|
243
237
|
end
|
244
238
|
|
245
239
|
def write(data)
|
246
240
|
if log_level_ok?(data[:level])
|
247
241
|
msg = unparse(data)
|
248
|
-
|
249
|
-
begin
|
250
|
-
stream.puts(msg)
|
251
|
-
rescue NoMethodError => e
|
252
|
-
raise
|
253
|
-
end
|
254
|
-
end
|
242
|
+
stream.log(msg)
|
255
243
|
end
|
256
244
|
end
|
257
245
|
|
data/lib/scrolls/syslog.rb
CHANGED
data/lib/scrolls/version.rb
CHANGED
data/test/test_scrolls.rb
CHANGED
@@ -14,7 +14,7 @@ class TestScrolls < Test::Unit::TestCase
|
|
14
14
|
end
|
15
15
|
|
16
16
|
def test_construct
|
17
|
-
assert_equal
|
17
|
+
assert_equal Scrolls::IOLog, Scrolls.stream.class
|
18
18
|
end
|
19
19
|
|
20
20
|
def test_default_global_context
|
@@ -130,7 +130,7 @@ class TestScrolls < Test::Unit::TestCase
|
|
130
130
|
|
131
131
|
oneline_backtrace = @out.string.gsub("\n", 'XX')
|
132
132
|
|
133
|
-
assert_match /test=exception at=exception.*test_log_exception.*XX
|
133
|
+
assert_match /test=exception at=exception.*test_log_exception.*XX/,
|
134
134
|
oneline_backtrace
|
135
135
|
end
|
136
136
|
|
@@ -165,6 +165,12 @@ class TestScrolls < Test::Unit::TestCase
|
|
165
165
|
assert_match /facility=184/, Scrolls.stream.inspect
|
166
166
|
end
|
167
167
|
|
168
|
+
def test_logging_message_with_syslog
|
169
|
+
Scrolls.stream = 'syslog'
|
170
|
+
Scrolls.facility = 'local7'
|
171
|
+
Scrolls.log "scrolls test"
|
172
|
+
end
|
173
|
+
|
168
174
|
def test_add_timestamp
|
169
175
|
Scrolls.add_timestamp = true
|
170
176
|
Scrolls.log(:test => "foo")
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: scrolls
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Curt Micol
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2017-08-22 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: Logging, easier, more consistent.
|
14
14
|
email:
|
@@ -26,6 +26,7 @@ files:
|
|
26
26
|
- docs/syslog.md
|
27
27
|
- lib/scrolls.rb
|
28
28
|
- lib/scrolls/atomic.rb
|
29
|
+
- lib/scrolls/iolog.rb
|
29
30
|
- lib/scrolls/log.rb
|
30
31
|
- lib/scrolls/parser.rb
|
31
32
|
- lib/scrolls/syslog.rb
|
@@ -56,7 +57,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
56
57
|
version: '0'
|
57
58
|
requirements: []
|
58
59
|
rubyforge_project:
|
59
|
-
rubygems_version: 2.
|
60
|
+
rubygems_version: 2.6.11
|
60
61
|
signing_key:
|
61
62
|
specification_version: 4
|
62
63
|
summary: When do we log? All the time.
|