logging 1.4.0 → 1.4.1
Sign up to get free protection for your applications and to get access to all the features.
- data/History.txt +5 -0
- data/lib/logging.rb +36 -16
- data/lib/logging/appenders.rb +11 -5
- data/lib/logging/layouts.rb +5 -5
- data/lib/logging/utils.rb +8 -0
- data/version.txt +1 -1
- metadata +3 -3
data/History.txt
CHANGED
data/lib/logging.rb
CHANGED
@@ -353,16 +353,34 @@ module Logging
|
|
353
353
|
# they will be joined to the end of the libray path using
|
354
354
|
# <tt>File.join</tt>.
|
355
355
|
#
|
356
|
-
def libpath( *args )
|
357
|
-
args.empty? ? LIBPATH : ::File.join(LIBPATH, args.flatten)
|
356
|
+
def libpath( *args, &block )
|
357
|
+
rv = args.empty? ? LIBPATH : ::File.join(LIBPATH, args.flatten)
|
358
|
+
if block
|
359
|
+
begin
|
360
|
+
$LOAD_PATH.unshift LIBPATH
|
361
|
+
rv = block.call
|
362
|
+
ensure
|
363
|
+
$LOAD_PATH.shift
|
364
|
+
end
|
365
|
+
end
|
366
|
+
return rv
|
358
367
|
end
|
359
368
|
|
360
369
|
# Returns the lpath for the module. If any arguments are given,
|
361
370
|
# they will be joined to the end of the path using
|
362
371
|
# <tt>File.join</tt>.
|
363
372
|
#
|
364
|
-
def path( *args )
|
365
|
-
args.empty? ? PATH : ::File.join(PATH, args.flatten)
|
373
|
+
def path( *args, &block )
|
374
|
+
rv = args.empty? ? PATH : ::File.join(PATH, args.flatten)
|
375
|
+
if block
|
376
|
+
begin
|
377
|
+
$LOAD_PATH.unshift PATH
|
378
|
+
rv = block.call
|
379
|
+
ensure
|
380
|
+
$LOAD_PATH.shift
|
381
|
+
end
|
382
|
+
end
|
383
|
+
return rv
|
366
384
|
end
|
367
385
|
|
368
386
|
# call-seq:
|
@@ -482,18 +500,20 @@ module Logging
|
|
482
500
|
end # module Logging
|
483
501
|
|
484
502
|
|
485
|
-
|
486
|
-
require
|
487
|
-
require
|
488
|
-
require
|
489
|
-
require
|
490
|
-
require
|
491
|
-
require
|
492
|
-
require
|
493
|
-
require
|
494
|
-
|
495
|
-
|
496
|
-
require
|
503
|
+
Logging.libpath {
|
504
|
+
require 'logging/appender'
|
505
|
+
require 'logging/layout'
|
506
|
+
require 'logging/log_event'
|
507
|
+
require 'logging/logger'
|
508
|
+
require 'logging/repository'
|
509
|
+
require 'logging/root_logger'
|
510
|
+
require 'logging/stats'
|
511
|
+
require 'logging/appenders'
|
512
|
+
require 'logging/layouts'
|
513
|
+
|
514
|
+
require 'logging/config/configurator'
|
515
|
+
require 'logging/config/yaml_configurator'
|
516
|
+
}
|
497
517
|
|
498
518
|
|
499
519
|
# This exit handler will close all the appenders that exist in the system.
|
data/lib/logging/appenders.rb
CHANGED
@@ -122,10 +122,16 @@ module Logging
|
|
122
122
|
end # module Appenders
|
123
123
|
end # module Logging
|
124
124
|
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
require
|
129
|
-
|
125
|
+
Logging.libpath {
|
126
|
+
require 'logging/appenders/buffering'
|
127
|
+
require 'logging/appenders/io'
|
128
|
+
require 'logging/appenders/console'
|
129
|
+
require 'logging/appenders/email'
|
130
|
+
require 'logging/appenders/file'
|
131
|
+
require 'logging/appenders/growl'
|
132
|
+
require 'logging/appenders/rolling_file'
|
133
|
+
require 'logging/appenders/string_io'
|
134
|
+
require 'logging/appenders/syslog'
|
135
|
+
}
|
130
136
|
|
131
137
|
# EOF
|
data/lib/logging/layouts.rb
CHANGED
@@ -38,10 +38,10 @@ module Logging
|
|
38
38
|
end # module Layouts
|
39
39
|
end # module Logging
|
40
40
|
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
require
|
45
|
-
|
41
|
+
Logging.libpath {
|
42
|
+
require 'logging/layouts/basic'
|
43
|
+
require 'logging/layouts/parseable'
|
44
|
+
require 'logging/layouts/pattern'
|
45
|
+
}
|
46
46
|
|
47
47
|
# EOF
|
data/lib/logging/utils.rb
CHANGED
@@ -162,6 +162,14 @@ class File
|
|
162
162
|
flock LOCK_UN
|
163
163
|
end
|
164
164
|
|
165
|
+
# :stopdoc:
|
166
|
+
if %r/mswin|mingw/ =~ RUBY_PLATFORM
|
167
|
+
undef :flock?, :flock_sh
|
168
|
+
def flock?() yield; end
|
169
|
+
def flock_sh() yield; end
|
170
|
+
end
|
171
|
+
# :startdoc:
|
172
|
+
|
165
173
|
end
|
166
174
|
|
167
175
|
# --------------------------------------------------------------------------
|
data/version.txt
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.4.
|
1
|
+
1.4.1
|
metadata
CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
segments:
|
6
6
|
- 1
|
7
7
|
- 4
|
8
|
-
-
|
9
|
-
version: 1.4.
|
8
|
+
- 1
|
9
|
+
version: 1.4.1
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- Tim Pease
|
@@ -14,7 +14,7 @@ autorequire:
|
|
14
14
|
bindir: bin
|
15
15
|
cert_chain: []
|
16
16
|
|
17
|
-
date: 2010-03-
|
17
|
+
date: 2010-03-23 00:00:00 -06:00
|
18
18
|
default_executable:
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|