logging 0.5.1 → 0.5.2
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.
- data/History.txt +5 -0
- data/lib/logging.rb +12 -12
- data/lib/logging/appender.rb +4 -4
- data/lib/logging/appenders/growl.rb +24 -20
- data/lib/logging/appenders/syslog.rb +3 -3
- data/lib/logging/config/yaml_configurator.rb +2 -2
- data/lib/logging/layout.rb +7 -7
- data/lib/logging/layouts/pattern.rb +3 -3
- data/lib/logging/log_event.rb +3 -3
- data/lib/logging/logger.rb +16 -16
- data/lib/logging/repository.rb +4 -4
- data/lib/logging/root_logger.rb +3 -3
- data/test/appenders/test_io.rb +2 -2
- data/test/appenders/test_syslog.rb +2 -2
- data/test/layouts/test_basic.rb +3 -2
- data/test/layouts/test_pattern.rb +3 -2
- data/test/setup.rb +14 -5
- data/test/test_layout.rb +2 -2
- data/test/test_logger.rb +2 -2
- data/test/test_repository.rb +2 -2
- metadata +2 -2
data/History.txt
CHANGED
data/lib/logging.rb
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# $Id: logging.rb
|
1
|
+
# $Id: logging.rb 56 2007-11-29 04:44:28Z tim_pease $
|
2
2
|
|
3
3
|
require 'logging/repository'
|
4
4
|
|
@@ -22,7 +22,7 @@ require 'logging/config/yaml_configurator'
|
|
22
22
|
#
|
23
23
|
module Logging
|
24
24
|
|
25
|
-
VERSION = '0.5.
|
25
|
+
VERSION = '0.5.2' # :nodoc:
|
26
26
|
|
27
27
|
LEVELS = {} # :nodoc:
|
28
28
|
LNAMES = {} # :nodoc:
|
@@ -38,7 +38,7 @@ module Logging
|
|
38
38
|
#
|
39
39
|
def configure( filename )
|
40
40
|
case File.extname(filename)
|
41
|
-
when '.yaml', '.yml'
|
41
|
+
when '.yaml', '.yml'
|
42
42
|
::Logging::Config::YamlConfigurator.load(filename)
|
43
43
|
else raise ArgumentError, 'unknown configuration file format' end
|
44
44
|
end
|
@@ -91,8 +91,8 @@ module Logging
|
|
91
91
|
size = args.shift
|
92
92
|
|
93
93
|
name = case dev
|
94
|
-
when String
|
95
|
-
when File
|
94
|
+
when String; dev
|
95
|
+
when File; dev.path
|
96
96
|
else dev.object_id.to_s end
|
97
97
|
|
98
98
|
repo = ::Logging::Repository.instance
|
@@ -229,8 +229,8 @@ module Logging
|
|
229
229
|
# Convert the given level into a connaconical form - a lowercase string.
|
230
230
|
def levelify( level )
|
231
231
|
case level
|
232
|
-
when String
|
233
|
-
when Symbol
|
232
|
+
when String; level.downcase
|
233
|
+
when Symbol; level.to_s.downcase
|
234
234
|
else raise ArgumentError, "levels must be a String or Symbol" end
|
235
235
|
end
|
236
236
|
|
@@ -238,8 +238,8 @@ module Logging
|
|
238
238
|
def level_num( level )
|
239
239
|
l = levelify level
|
240
240
|
case l
|
241
|
-
when 'all'
|
242
|
-
when 'off'
|
241
|
+
when 'all'; 0
|
242
|
+
when 'off'; LEVELS.length
|
243
243
|
else begin; Integer(l); rescue ArgumentError; LEVELS[l] end end
|
244
244
|
end
|
245
245
|
|
@@ -247,10 +247,10 @@ module Logging
|
|
247
247
|
def options( opts = {} )
|
248
248
|
lambda do |*args|
|
249
249
|
keys, default, ignored = args
|
250
|
-
catch(
|
250
|
+
catch(:opt) do
|
251
251
|
Array(keys).each do |key|
|
252
|
-
[key, key.to_s, key.to_s.intern].each do |
|
253
|
-
throw
|
252
|
+
[key, key.to_s, key.to_s.intern].each do |k|
|
253
|
+
throw :opt, opts[k] if opts.has_key?(k)
|
254
254
|
end
|
255
255
|
end
|
256
256
|
default
|
data/lib/logging/appender.rb
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# $Id: appender.rb
|
1
|
+
# $Id: appender.rb 52 2007-11-27 23:53:23Z tim_pease $
|
2
2
|
|
3
3
|
require 'thread'
|
4
4
|
require 'logging'
|
@@ -110,9 +110,9 @@ module Logging
|
|
110
110
|
#
|
111
111
|
def level=( level )
|
112
112
|
lvl = case level
|
113
|
-
when String, Symbol
|
114
|
-
when Fixnum
|
115
|
-
when nil
|
113
|
+
when String, Symbol; ::Logging::level_num(level)
|
114
|
+
when Fixnum; level
|
115
|
+
when nil; 0
|
116
116
|
else
|
117
117
|
raise ArgumentError,
|
118
118
|
"level must be a String, Symbol, or Integer"
|
@@ -1,4 +1,4 @@
|
|
1
|
-
# $Id: growl.rb
|
1
|
+
# $Id: growl.rb 56 2007-11-29 04:44:28Z tim_pease $
|
2
2
|
|
3
3
|
require 'logging/appender'
|
4
4
|
|
@@ -22,7 +22,7 @@ module Appenders
|
|
22
22
|
def initialize( name, opts = {} )
|
23
23
|
super
|
24
24
|
|
25
|
-
@growl = "growlnotify -n '#{@name}' -t '%s' -m '%s' -p %d"
|
25
|
+
@growl = "growlnotify -w -n '#{@name}' -t '%s' -m '%s' -p %d &"
|
26
26
|
|
27
27
|
getopt = ::Logging.options(opts)
|
28
28
|
@coalesce = getopt[:coalesce, false]
|
@@ -82,7 +82,8 @@ module Appenders
|
|
82
82
|
|
83
83
|
if @title_sep
|
84
84
|
title, message = message.split(@title_sep)
|
85
|
-
title, message =
|
85
|
+
title, message = '', title if message.nil?
|
86
|
+
title.strip!
|
86
87
|
end
|
87
88
|
|
88
89
|
growl(title, message, priority)
|
@@ -108,7 +109,8 @@ module Appenders
|
|
108
109
|
|
109
110
|
if @title_sep
|
110
111
|
title, message = message.split(@title_sep)
|
111
|
-
title, message =
|
112
|
+
title, message = '', title if message.nil?
|
113
|
+
title.strip!
|
112
114
|
end
|
113
115
|
|
114
116
|
sync {growl(title, message, 0)}
|
@@ -126,8 +128,8 @@ module Appenders
|
|
126
128
|
#
|
127
129
|
def growl_level_num( level )
|
128
130
|
level = case level
|
129
|
-
when Integer
|
130
|
-
when String
|
131
|
+
when Integer; level
|
132
|
+
when String; Integer(level)
|
131
133
|
else raise ArgumentError, "unkonwn level '#{level}'" end
|
132
134
|
if level < -2 or level > 2
|
133
135
|
raise ArgumentError, "level '#{level}' is not in range -2..2"
|
@@ -159,17 +161,20 @@ module Appenders
|
|
159
161
|
#
|
160
162
|
def coalesce( *msg )
|
161
163
|
@c_mutex.synchronize do
|
162
|
-
if @
|
163
|
-
@
|
164
|
+
if @c_queue.empty?
|
165
|
+
@c_queue << msg
|
164
166
|
@c_thread.run
|
165
167
|
|
166
168
|
else
|
167
|
-
|
168
|
-
msg
|
169
|
+
qmsg = @c_queue.last
|
170
|
+
if qmsg.first != msg.first or qmsg.last != msg.last
|
171
|
+
@c_queue << msg
|
172
|
+
else
|
173
|
+
qmsg[1] << "\n" << msg[1]
|
174
|
+
end
|
169
175
|
end
|
170
176
|
end
|
171
177
|
|
172
|
-
system @growl % msg unless msg.nil?
|
173
178
|
Thread.pass
|
174
179
|
end
|
175
180
|
|
@@ -183,19 +188,18 @@ module Appenders
|
|
183
188
|
#
|
184
189
|
def setup_coalescing
|
185
190
|
@c_mutex = Mutex.new
|
186
|
-
@
|
191
|
+
@c_queue = []
|
187
192
|
|
188
193
|
@c_thread = Thread.new do
|
194
|
+
Thread.stop
|
189
195
|
loop do
|
190
|
-
Thread.stop
|
191
196
|
sleep 0.5
|
192
|
-
@c_mutex.synchronize
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
end # Thread.new
|
197
|
+
@c_mutex.synchronize {
|
198
|
+
system(@growl % @c_queue.shift) until @c_queue.empty?
|
199
|
+
}
|
200
|
+
Thread.stop if @c_queue.empty?
|
201
|
+
end # loop
|
202
|
+
end # Thread.new
|
199
203
|
end
|
200
204
|
|
201
205
|
end # class Growl
|
@@ -1,4 +1,4 @@
|
|
1
|
-
# $Id: syslog.rb
|
1
|
+
# $Id: syslog.rb 52 2007-11-27 23:53:23Z tim_pease $
|
2
2
|
|
3
3
|
begin
|
4
4
|
require 'logging/appender'
|
@@ -203,8 +203,8 @@ module Appenders
|
|
203
203
|
#
|
204
204
|
def syslog_level_num( level )
|
205
205
|
case level
|
206
|
-
when Integer
|
207
|
-
when String, Symbol
|
206
|
+
when Integer; level
|
207
|
+
when String, Symbol
|
208
208
|
level = level.to_s.upcase
|
209
209
|
self.class.const_get level
|
210
210
|
else
|
@@ -1,4 +1,4 @@
|
|
1
|
-
# $Id: yaml_configurator.rb
|
1
|
+
# $Id: yaml_configurator.rb 52 2007-11-27 23:53:23Z tim_pease $
|
2
2
|
|
3
3
|
require 'yaml'
|
4
4
|
require 'logging'
|
@@ -29,7 +29,7 @@ module Config
|
|
29
29
|
when String
|
30
30
|
io = File.open(file, 'r')
|
31
31
|
close = true
|
32
|
-
when IO
|
32
|
+
when IO; io = file
|
33
33
|
else raise Error, 'expecting a filename or a File' end
|
34
34
|
|
35
35
|
begin new(io).load; ensure; io.close if close end
|
data/lib/logging/layout.rb
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# $Id: layout.rb
|
1
|
+
# $Id: layout.rb 52 2007-11-27 23:53:23Z tim_pease $
|
2
2
|
|
3
3
|
require 'yaml'
|
4
4
|
require 'logging'
|
@@ -37,7 +37,7 @@ module Logging
|
|
37
37
|
f = f.intern if f.instance_of? String
|
38
38
|
|
39
39
|
@obj_format = case f
|
40
|
-
when :inspect, :yaml
|
40
|
+
when :inspect, :yaml; f
|
41
41
|
else :string end
|
42
42
|
end
|
43
43
|
|
@@ -76,19 +76,19 @@ module Logging
|
|
76
76
|
#
|
77
77
|
def format_obj( obj )
|
78
78
|
case obj
|
79
|
-
when String
|
80
|
-
when Exception
|
79
|
+
when String; obj
|
80
|
+
when Exception
|
81
81
|
str = "<#{obj.class.name}> #{obj.message}"
|
82
82
|
unless obj.backtrace.nil?
|
83
83
|
str << "\n\t" << obj.backtrace.join("\n\t")
|
84
84
|
end
|
85
85
|
str
|
86
|
-
when nil
|
86
|
+
when nil; "<#{obj.class.name}> nil"
|
87
87
|
else
|
88
88
|
str = "<#{obj.class.name}> "
|
89
89
|
str << case @obj_format
|
90
|
-
when :inspect
|
91
|
-
when :yaml
|
90
|
+
when :inspect; obj.inspect
|
91
|
+
when :yaml; "\n#{obj.to_yaml}"
|
92
92
|
else obj.to_s end
|
93
93
|
str
|
94
94
|
end
|
@@ -1,4 +1,4 @@
|
|
1
|
-
# $Id: pattern.rb
|
1
|
+
# $Id: pattern.rb 52 2007-11-27 23:53:23Z tim_pease $
|
2
2
|
|
3
3
|
require 'logging'
|
4
4
|
require 'logging/layout'
|
@@ -190,11 +190,11 @@ module Layouts
|
|
190
190
|
code << m[1] unless m[1].empty?
|
191
191
|
|
192
192
|
case m[3]
|
193
|
-
when '%'
|
193
|
+
when '%'; code << '%%'
|
194
194
|
when *DIRECTIVE_TABLE.keys
|
195
195
|
code << m[2] + 's'
|
196
196
|
args << DIRECTIVE_TABLE[m[3]]
|
197
|
-
when nil
|
197
|
+
when nil; break
|
198
198
|
else
|
199
199
|
raise ArgumentError, "illegal format character - '#{m[3]}'"
|
200
200
|
end
|
data/lib/logging/log_event.rb
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# $Id: log_event.rb
|
1
|
+
# $Id: log_event.rb 53 2007-11-28 00:21:33Z tim_pease $
|
2
2
|
|
3
3
|
module Logging
|
4
4
|
|
@@ -31,8 +31,8 @@ module Logging
|
|
31
31
|
@file = @line = @method = ''
|
32
32
|
|
33
33
|
if trace
|
34
|
-
t = Kernel.caller
|
35
|
-
|
34
|
+
t = Kernel.caller[2]
|
35
|
+
return if t.nil?
|
36
36
|
|
37
37
|
m = CALLER_RGXP.match(t)
|
38
38
|
@file = m[1]
|
data/lib/logging/logger.rb
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# $Id: logger.rb
|
1
|
+
# $Id: logger.rb 52 2007-11-27 23:53:23Z tim_pease $
|
2
2
|
|
3
3
|
require 'thread'
|
4
4
|
require 'logging'
|
@@ -143,7 +143,7 @@ module Logging
|
|
143
143
|
#
|
144
144
|
def initialize( name )
|
145
145
|
case name
|
146
|
-
when String
|
146
|
+
when String
|
147
147
|
raise(ArgumentError, "logger must have a name") if name.empty?
|
148
148
|
else raise(ArgumentError, "logger name must be a String") end
|
149
149
|
|
@@ -166,9 +166,9 @@ module Logging
|
|
166
166
|
#
|
167
167
|
def <=>( other )
|
168
168
|
case other
|
169
|
-
when self
|
170
|
-
when ::Logging::RootLogger
|
171
|
-
when ::Logging::Logger
|
169
|
+
when self; 0
|
170
|
+
when ::Logging::RootLogger; 1
|
171
|
+
when ::Logging::Logger; @name <=> other.name
|
172
172
|
else raise ArgumentError, 'expecting a Logger instance' end
|
173
173
|
end
|
174
174
|
|
@@ -193,9 +193,9 @@ module Logging
|
|
193
193
|
#
|
194
194
|
def additive=( val )
|
195
195
|
@additive = case val
|
196
|
-
when true, 'true'
|
197
|
-
when false, 'false'
|
198
|
-
when nil
|
196
|
+
when true, 'true'; true
|
197
|
+
when false, 'false'; false
|
198
|
+
when nil; @additive
|
199
199
|
else raise ArgumentError, 'expecting a boolean' end
|
200
200
|
end
|
201
201
|
|
@@ -208,9 +208,9 @@ module Logging
|
|
208
208
|
#
|
209
209
|
def trace=( val )
|
210
210
|
@trace = case val
|
211
|
-
when true, 'true'
|
212
|
-
when false, 'false'
|
213
|
-
when nil
|
211
|
+
when true, 'true'; true
|
212
|
+
when false, 'false'; false
|
213
|
+
when nil; @trace
|
214
214
|
else raise ArgumentError, 'expecting a boolean' end
|
215
215
|
end
|
216
216
|
|
@@ -244,9 +244,9 @@ module Logging
|
|
244
244
|
#
|
245
245
|
def level=( level )
|
246
246
|
lvl = case level
|
247
|
-
when String, Symbol
|
248
|
-
when Fixnum
|
249
|
-
when nil
|
247
|
+
when String, Symbol; ::Logging::level_num(level)
|
248
|
+
when Fixnum; level
|
249
|
+
when nil; @parent.level
|
250
250
|
else
|
251
251
|
raise ArgumentError,
|
252
252
|
"level must be a String, Symbol, or Integer"
|
@@ -299,8 +299,8 @@ module Logging
|
|
299
299
|
args.each do |arg|
|
300
300
|
@appenders.delete_if do |a|
|
301
301
|
case arg
|
302
|
-
when String
|
303
|
-
when ::Logging::Appender
|
302
|
+
when String; arg == a.name
|
303
|
+
when ::Logging::Appender; arg.object_id == a.object_id
|
304
304
|
else
|
305
305
|
raise TypeError, "#{arg.inspect} is not a 'Logging::Appender'"
|
306
306
|
end
|
data/lib/logging/repository.rb
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# $Id: repository.rb
|
1
|
+
# $Id: repository.rb 52 2007-11-27 23:53:23Z tim_pease $
|
2
2
|
|
3
3
|
require 'singleton'
|
4
4
|
require 'logging/root_logger'
|
@@ -141,9 +141,9 @@ module Logging
|
|
141
141
|
#
|
142
142
|
def to_key( key )
|
143
143
|
case key
|
144
|
-
when Symbol, String
|
145
|
-
when Class
|
146
|
-
when Object
|
144
|
+
when Symbol, String; key
|
145
|
+
when Class; key.name
|
146
|
+
when Object; key.class.name
|
147
147
|
end
|
148
148
|
end
|
149
149
|
|
data/lib/logging/root_logger.rb
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# $Id: root_logger.rb
|
1
|
+
# $Id: root_logger.rb 52 2007-11-27 23:53:23Z tim_pease $
|
2
2
|
|
3
3
|
require 'logging'
|
4
4
|
require 'logging/logger'
|
@@ -42,8 +42,8 @@ module Logging
|
|
42
42
|
#
|
43
43
|
def <=>( other )
|
44
44
|
case other
|
45
|
-
when self
|
46
|
-
when ::Logging::Logger
|
45
|
+
when self; 0
|
46
|
+
when ::Logging::Logger; -1
|
47
47
|
else raise ArgumentError, 'expecting a Logger instance' end
|
48
48
|
end
|
49
49
|
|
data/test/appenders/test_io.rb
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# $Id: test_io.rb
|
1
|
+
# $Id: test_io.rb 53 2007-11-28 00:21:33Z tim_pease $
|
2
2
|
|
3
3
|
require 'test/setup.rb'
|
4
4
|
require 'stringio'
|
@@ -23,7 +23,7 @@ module TestAppenders
|
|
23
23
|
event = ::Logging::LogEvent.new('TestLogger', @levels['warn'],
|
24
24
|
[1, 2, 3, 4], false)
|
25
25
|
@appender.append event
|
26
|
-
assert_equal " WARN TestLogger : <Array>
|
26
|
+
assert_equal " WARN TestLogger : <Array> #{[1, 2, 3, 4]}\n", readline
|
27
27
|
assert_raise(EOFError) {readline}
|
28
28
|
|
29
29
|
event.level = @levels['debug']
|
@@ -1,4 +1,4 @@
|
|
1
|
-
# $Id: test_syslog.rb
|
1
|
+
# $Id: test_syslog.rb 53 2007-11-28 00:21:33Z tim_pease $
|
2
2
|
|
3
3
|
require 'test/setup.rb'
|
4
4
|
|
@@ -53,7 +53,7 @@ module TestAppenders
|
|
53
53
|
stderr[1].close
|
54
54
|
Process.waitpid(pid)
|
55
55
|
|
56
|
-
assert_equal("syslog_test: INFO TestLogger : <Array>
|
56
|
+
assert_equal("syslog_test: INFO TestLogger : <Array> #{[1,2,3,4]}\n",
|
57
57
|
stderr[0].gets)
|
58
58
|
assert_equal("syslog_test: DEBUG TestLogger : the big log message\n",
|
59
59
|
stderr[0].gets)
|
data/test/layouts/test_basic.rb
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# $Id: test_basic.rb
|
1
|
+
# $Id: test_basic.rb 53 2007-11-28 00:21:33Z tim_pease $
|
2
2
|
|
3
3
|
require 'test/setup.rb'
|
4
4
|
|
@@ -21,7 +21,8 @@ module TestLayouts
|
|
21
21
|
assert_equal " INFO ArrayLogger : log message\n", @layout.format(event)
|
22
22
|
|
23
23
|
event.data = [1, 2, 3, 4]
|
24
|
-
assert_equal
|
24
|
+
assert_equal(" INFO ArrayLogger : <Array> #{[1,2,3,4]}\n",
|
25
|
+
@layout.format(event))
|
25
26
|
|
26
27
|
event.level = @levels['debug']
|
27
28
|
event.data = 'and another message'
|
@@ -1,4 +1,4 @@
|
|
1
|
-
# $Id: test_pattern.rb
|
1
|
+
# $Id: test_pattern.rb 53 2007-11-28 00:21:33Z tim_pease $
|
2
2
|
|
3
3
|
require 'test/setup.rb'
|
4
4
|
|
@@ -65,7 +65,8 @@ module TestLayouts
|
|
65
65
|
assert_match rgxp, @layout.format(event)
|
66
66
|
|
67
67
|
event.data = [1, 2, 3, 4]
|
68
|
-
rgxp = Regexp.new(sprintf(fmt, 'INFO ', 'ArrayLogger',
|
68
|
+
rgxp = Regexp.new(sprintf(fmt, 'INFO ', 'ArrayLogger',
|
69
|
+
Regexp.escape("<Array> #{[1,2,3,4]}")))
|
69
70
|
assert_match rgxp, @layout.format(event)
|
70
71
|
|
71
72
|
event.level = @levels['debug']
|
data/test/setup.rb
CHANGED
@@ -1,7 +1,12 @@
|
|
1
|
-
# $Id: setup.rb
|
1
|
+
# $Id: setup.rb 53 2007-11-28 00:21:33Z tim_pease $
|
2
2
|
|
3
3
|
require 'test/unit'
|
4
4
|
|
5
|
+
# This line is needed for Ruby 1.9 -- hashes throw a "KeyError" in 1.9
|
6
|
+
# whereas they throw an "IndexError" in 1.8
|
7
|
+
#
|
8
|
+
KeyError = IndexError if not defined? KeyError
|
9
|
+
|
5
10
|
begin
|
6
11
|
require 'logging'
|
7
12
|
rescue LoadError
|
@@ -33,10 +38,14 @@ module LoggingTestCase
|
|
33
38
|
end
|
34
39
|
|
35
40
|
::Logging::Repository.class_eval do
|
36
|
-
@
|
37
|
-
|
38
|
-
|
39
|
-
|
41
|
+
if defined?(@singleton__instance__)
|
42
|
+
@singleton__instance__ = nil
|
43
|
+
else
|
44
|
+
@__instance__ = nil
|
45
|
+
class << self
|
46
|
+
nonce = class << Singleton; self; end
|
47
|
+
define_method(:instance, nonce::FirstInstanceCall)
|
48
|
+
end
|
40
49
|
end
|
41
50
|
end
|
42
51
|
|
data/test/test_layout.rb
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# $Id: test_layout.rb
|
1
|
+
# $Id: test_layout.rb 53 2007-11-28 00:21:33Z tim_pease $
|
2
2
|
|
3
3
|
require 'test/setup.rb'
|
4
4
|
|
@@ -67,7 +67,7 @@ module TestLogging
|
|
67
67
|
|
68
68
|
obj = [1, 2, 3, 4]
|
69
69
|
r = @layout.send :format_obj, obj
|
70
|
-
assert_equal
|
70
|
+
assert_equal "<Array> #{[1,2,3,4]}", r
|
71
71
|
|
72
72
|
obj = %w( one two three four )
|
73
73
|
@layout = ::Logging::Layout.new :format_as => :inspect
|
data/test/test_logger.rb
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# $Id: test_logger.rb
|
1
|
+
# $Id: test_logger.rb 53 2007-11-28 00:21:33Z tim_pease $
|
2
2
|
|
3
3
|
require 'test/setup.rb'
|
4
4
|
require 'stringio'
|
@@ -287,7 +287,7 @@ module TestLogging
|
|
287
287
|
assert_nil a2.readline
|
288
288
|
|
289
289
|
log.warn [1,2,3,4]
|
290
|
-
assert_equal " WARN A Logger : <Array>
|
290
|
+
assert_equal " WARN A Logger : <Array> #{[1,2,3,4]}\n", a1.readline
|
291
291
|
assert_nil a1.readline
|
292
292
|
assert_nil a2.readline
|
293
293
|
|
data/test/test_repository.rb
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# $Id: test_repository.rb
|
1
|
+
# $Id: test_repository.rb 53 2007-11-28 00:21:33Z tim_pease $
|
2
2
|
|
3
3
|
require 'test/setup.rb'
|
4
4
|
|
@@ -47,7 +47,7 @@ module TestLogging
|
|
47
47
|
assert_same @repo[:root], @repo.fetch(:root)
|
48
48
|
|
49
49
|
assert !@repo.has_logger?('A')
|
50
|
-
assert_raise(
|
50
|
+
assert_raise(KeyError) {@repo.fetch 'A'}
|
51
51
|
|
52
52
|
%w(A A::B A::B::C::D A::B::C::E A::B::C::F).each do |name|
|
53
53
|
::Logging::Logger.new(name)
|
metadata
CHANGED
@@ -3,8 +3,8 @@ rubygems_version: 0.9.4
|
|
3
3
|
specification_version: 1
|
4
4
|
name: logging
|
5
5
|
version: !ruby/object:Gem::Version
|
6
|
-
version: 0.5.
|
7
|
-
date: 2007-11-
|
6
|
+
version: 0.5.2
|
7
|
+
date: 2007-11-28 00:00:00 -07:00
|
8
8
|
summary: A flexible and extendable logging library for Ruby
|
9
9
|
require_paths:
|
10
10
|
- lib
|