logging 0.9.5 → 0.9.6
Sign up to get free protection for your applications and to get access to all the features.
- data/History.txt +6 -0
- data/Rakefile +1 -0
- data/lib/logging.rb +1 -1
- data/lib/logging/appenders/growl.rb +1 -1
- data/lib/logging/config/configurator.rb +1 -1
- data/lib/logging/log_event.rb +3 -1
- data/lib/logging/utils.rb +1 -1
- data/logging.gemspec +9 -9
- data/tasks/setup.rb +8 -4
- data/test/appenders/test_syslog.rb +5 -2
- data/test/setup.rb +6 -1
- data/test/test_utils.rb +7 -5
- metadata +3 -3
data/History.txt
CHANGED
data/Rakefile
CHANGED
data/lib/logging.rb
CHANGED
@@ -17,7 +17,7 @@ begin require 'fastthread'; rescue LoadError; end
|
|
17
17
|
module Logging
|
18
18
|
|
19
19
|
# :stopdoc:
|
20
|
-
VERSION = '0.9.
|
20
|
+
VERSION = '0.9.6'
|
21
21
|
LIBPATH = ::File.expand_path(::File.dirname(__FILE__)) + ::File::SEPARATOR
|
22
22
|
PATH = ::File.dirname(LIBPATH) + ::File::SEPARATOR
|
23
23
|
WIN32 = %r/djgpp|(cyg|ms|bcc)win|mingw/ =~ RUBY_PLATFORM
|
@@ -36,7 +36,7 @@ module Logging::Appenders
|
|
36
36
|
setup_coalescing if @coalesce
|
37
37
|
|
38
38
|
# make sure the growlnotify command can be called
|
39
|
-
unless system('growlnotify -v
|
39
|
+
unless system('growlnotify -v >> /dev/null 2>&1')
|
40
40
|
self.level = :off
|
41
41
|
::Logging.log_internal {'growl notifications have been disabled'}
|
42
42
|
end
|
data/lib/logging/log_event.rb
CHANGED
@@ -13,6 +13,8 @@ module Logging
|
|
13
13
|
# * $2 == line number
|
14
14
|
# * $3 == method name (might be nil)
|
15
15
|
CALLER_RGXP = %r/([\.\/\(\)\w]+):(\d+)(?::in `(\w+)')?/o
|
16
|
+
|
17
|
+
CALLER_INDEX = RUBY_PLATFORM[%r/^java/i] ? 1 : 2
|
16
18
|
# :startdoc:
|
17
19
|
|
18
20
|
# call-seq:
|
@@ -30,7 +32,7 @@ module Logging
|
|
30
32
|
@file = @line = @method = ''
|
31
33
|
|
32
34
|
if trace
|
33
|
-
t = Kernel.caller[
|
35
|
+
t = Kernel.caller[CALLER_INDEX]
|
34
36
|
return if t.nil?
|
35
37
|
|
36
38
|
m = CALLER_RGXP.match(t)
|
data/lib/logging/utils.rb
CHANGED
@@ -81,7 +81,7 @@ class Module
|
|
81
81
|
# anonymous module, the string 'anonymous' will be returned.
|
82
82
|
#
|
83
83
|
def logger_name
|
84
|
-
return name unless name.empty?
|
84
|
+
return name unless name.nil? or name.empty?
|
85
85
|
|
86
86
|
# check if this is a metaclass (or eigenclass)
|
87
87
|
if ancestors.include? Class
|
data/logging.gemspec
CHANGED
@@ -2,15 +2,15 @@
|
|
2
2
|
|
3
3
|
Gem::Specification.new do |s|
|
4
4
|
s.name = %q{logging}
|
5
|
-
s.version = "0.9.
|
5
|
+
s.version = "0.9.6"
|
6
6
|
|
7
7
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
8
8
|
s.authors = ["Tim Pease"]
|
9
|
-
s.date = %q{2009-01
|
9
|
+
s.date = %q{2009-02-01}
|
10
10
|
s.description = %q{Logging is a flexible logging library for use in Ruby programs based on the design of Java's log4j library. It features a hierarchical logging system, custom level names, multiple output destinations per log event, custom formatting, and more.}
|
11
11
|
s.email = %q{tim.pease@gmail.com}
|
12
12
|
s.extra_rdoc_files = ["History.txt", "README.rdoc"]
|
13
|
-
s.files = ["History.txt", "README.rdoc", "Rakefile", "data/bad_logging_1.rb", "data/bad_logging_2.rb", "data/logging.rb", "data/logging.yaml", "data/simple_logging.rb", "lib/logging.rb", "lib/logging/appender.rb", "lib/logging/appenders/buffering.rb", "lib/logging/appenders/console.rb", "lib/logging/appenders/email.rb", "lib/logging/appenders/file.rb", "lib/logging/appenders/growl.rb", "lib/logging/appenders/io.rb", "lib/logging/appenders/rolling_file.rb", "lib/logging/appenders/syslog.rb", "lib/logging/config/configurator.rb", "lib/logging/config/yaml_configurator.rb", "lib/logging/layout.rb", "lib/logging/layouts/basic.rb", "lib/logging/layouts/pattern.rb", "lib/logging/log_event.rb", "lib/logging/logger.rb", "lib/logging/repository.rb", "lib/logging/root_logger.rb", "lib/logging/stats.rb", "lib/logging/utils.rb", "test/appenders/test_buffered_io.rb", "test/appenders/test_console.rb", "test/appenders/test_email.rb", "test/appenders/test_file.rb", "test/appenders/test_growl.rb", "test/appenders/test_io.rb", "test/appenders/test_rolling_file.rb", "test/appenders/test_syslog.rb", "test/benchmark.rb", "test/config/test_configurator.rb", "test/config/test_yaml_configurator.rb", "test/layouts/test_basic.rb", "test/layouts/test_pattern.rb", "test/setup.rb", "test/test_appender.rb", "test/test_layout.rb", "test/test_log_event.rb", "test/test_logger.rb", "test/test_logging.rb", "test/test_repository.rb", "test/test_root_logger.rb", "test/test_stats.rb", "test/test_utils.rb"]
|
13
|
+
s.files = ["History.txt", "README.rdoc", "Rakefile", "data/bad_logging_1.rb", "data/bad_logging_2.rb", "data/logging.rb", "data/logging.yaml", "data/simple_logging.rb", "lib/logging.rb", "lib/logging/appender.rb", "lib/logging/appenders/buffering.rb", "lib/logging/appenders/console.rb", "lib/logging/appenders/email.rb", "lib/logging/appenders/file.rb", "lib/logging/appenders/growl.rb", "lib/logging/appenders/io.rb", "lib/logging/appenders/rolling_file.rb", "lib/logging/appenders/syslog.rb", "lib/logging/config/configurator.rb", "lib/logging/config/yaml_configurator.rb", "lib/logging/layout.rb", "lib/logging/layouts/basic.rb", "lib/logging/layouts/pattern.rb", "lib/logging/log_event.rb", "lib/logging/logger.rb", "lib/logging/repository.rb", "lib/logging/root_logger.rb", "lib/logging/stats.rb", "lib/logging/utils.rb", "logging.gemspec", "test/appenders/test_buffered_io.rb", "test/appenders/test_console.rb", "test/appenders/test_email.rb", "test/appenders/test_file.rb", "test/appenders/test_growl.rb", "test/appenders/test_io.rb", "test/appenders/test_rolling_file.rb", "test/appenders/test_syslog.rb", "test/benchmark.rb", "test/config/test_configurator.rb", "test/config/test_yaml_configurator.rb", "test/layouts/test_basic.rb", "test/layouts/test_pattern.rb", "test/setup.rb", "test/test_appender.rb", "test/test_layout.rb", "test/test_log_event.rb", "test/test_logger.rb", "test/test_logging.rb", "test/test_repository.rb", "test/test_root_logger.rb", "test/test_stats.rb", "test/test_utils.rb"]
|
14
14
|
s.has_rdoc = true
|
15
15
|
s.homepage = %q{http://logging.rubyforge.org/}
|
16
16
|
s.rdoc_options = ["--main", "README.rdoc"]
|
@@ -25,17 +25,17 @@ Gem::Specification.new do |s|
|
|
25
25
|
s.specification_version = 2
|
26
26
|
|
27
27
|
if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
|
28
|
-
s.add_runtime_dependency(%q<flexmock>, [">= 0.8.
|
28
|
+
s.add_runtime_dependency(%q<flexmock>, [">= 0.8.3"])
|
29
29
|
s.add_runtime_dependency(%q<lockfile>, [">= 1.4.3"])
|
30
|
-
s.add_development_dependency(%q<bones>, [">= 2.3.
|
30
|
+
s.add_development_dependency(%q<bones>, [">= 2.3.1"])
|
31
31
|
else
|
32
|
-
s.add_dependency(%q<flexmock>, [">= 0.8.
|
32
|
+
s.add_dependency(%q<flexmock>, [">= 0.8.3"])
|
33
33
|
s.add_dependency(%q<lockfile>, [">= 1.4.3"])
|
34
|
-
s.add_dependency(%q<bones>, [">= 2.3.
|
34
|
+
s.add_dependency(%q<bones>, [">= 2.3.1"])
|
35
35
|
end
|
36
36
|
else
|
37
|
-
s.add_dependency(%q<flexmock>, [">= 0.8.
|
37
|
+
s.add_dependency(%q<flexmock>, [">= 0.8.3"])
|
38
38
|
s.add_dependency(%q<lockfile>, [">= 1.4.3"])
|
39
|
-
s.add_dependency(%q<bones>, [">= 2.3.
|
39
|
+
s.add_dependency(%q<bones>, [">= 2.3.1"])
|
40
40
|
end
|
41
41
|
end
|
data/tasks/setup.rb
CHANGED
@@ -262,12 +262,16 @@ def manifest
|
|
262
262
|
|
263
263
|
# process the ignore file and add the items there to the exclude list
|
264
264
|
if test(?f, PROJ.ignore_file)
|
265
|
-
ary =
|
265
|
+
ary = []
|
266
|
+
File.readlines(PROJ.ignore_file).each do |line|
|
266
267
|
next if line =~ comment
|
267
|
-
line.chomp
|
268
|
+
line.chomp!
|
269
|
+
line.strip!
|
270
|
+
next if line.nil? or line.empty?
|
271
|
+
|
272
|
+
glob = line =~ %r/\*\./ ? File.join('**', line) : line
|
273
|
+
Dir.glob(glob).each {|fn| ary << "^#{Regexp.escape(fn)}"}
|
268
274
|
end
|
269
|
-
ary.compact!
|
270
|
-
ary.delete ''
|
271
275
|
exclude.concat ary
|
272
276
|
end
|
273
277
|
|
@@ -14,6 +14,9 @@ module TestAppenders
|
|
14
14
|
super
|
15
15
|
::Logging.init
|
16
16
|
@levels = ::Logging::LEVELS
|
17
|
+
@logopt = defined?(::Syslog::LOG_NDELAY) ?
|
18
|
+
(::Syslog::LOG_PERROR | ::Syslog::LOG_NDELAY) :
|
19
|
+
(::Syslog::LOG_PERROR)
|
17
20
|
end
|
18
21
|
|
19
22
|
def test_append
|
@@ -148,7 +151,7 @@ module TestAppenders
|
|
148
151
|
def test_initialize_map
|
149
152
|
appender = ::Logging::Appenders::Syslog.new(
|
150
153
|
'syslog_test',
|
151
|
-
:logopt =>
|
154
|
+
:logopt => @logopt,
|
152
155
|
:map => {
|
153
156
|
:debug => :log_debug,
|
154
157
|
:info => :log_info,
|
@@ -171,7 +174,7 @@ module TestAppenders
|
|
171
174
|
layout = ::Logging::Layouts::Pattern.new(:pattern => '%5l %c : %m')
|
172
175
|
::Logging::Appenders::Syslog.new(
|
173
176
|
'syslog_test',
|
174
|
-
:logopt =>
|
177
|
+
:logopt => @logopt,
|
175
178
|
:facility => ::Syslog::LOG_USER,
|
176
179
|
:layout => layout
|
177
180
|
)
|
data/test/setup.rb
CHANGED
@@ -45,7 +45,12 @@ module LoggingTestCase
|
|
45
45
|
@__instance__ = nil
|
46
46
|
class << self
|
47
47
|
nonce = class << Singleton; self; end
|
48
|
-
|
48
|
+
if defined?(nonce::FirstInstanceCall)
|
49
|
+
define_method(:instance, nonce::FirstInstanceCall)
|
50
|
+
else
|
51
|
+
remove_method(:instance)
|
52
|
+
Singleton.__init__(::Logging::Repository)
|
53
|
+
end
|
49
54
|
end
|
50
55
|
end
|
51
56
|
end
|
data/test/test_utils.rb
CHANGED
@@ -87,24 +87,26 @@ module TestLogging
|
|
87
87
|
def test_logger_name
|
88
88
|
assert_equal 'Array', Array.logger_name
|
89
89
|
|
90
|
+
# some lines are commented out for compatibility with ruby 1.9
|
91
|
+
|
90
92
|
c = Class.new(Array)
|
91
|
-
|
93
|
+
# assert_equal '', c.name
|
92
94
|
assert_equal 'Array', c.logger_name
|
93
95
|
|
94
96
|
meta = class << Array; self; end
|
95
|
-
|
97
|
+
# assert_equal '', meta.name
|
96
98
|
assert_equal 'Array', meta.logger_name
|
97
99
|
|
98
100
|
m = Module.new
|
99
|
-
|
101
|
+
# assert_equal '', m.name
|
100
102
|
assert_equal 'anonymous', m.logger_name
|
101
103
|
|
102
104
|
c = Class.new(::Logging::Logger)
|
103
|
-
|
105
|
+
# assert_equal '', c.name
|
104
106
|
assert_equal 'Logging::Logger', c.logger_name
|
105
107
|
|
106
108
|
meta = class << ::Logging::Logger; self; end
|
107
|
-
|
109
|
+
# assert_equal '', meta.name
|
108
110
|
assert_equal 'Logging::Logger', meta.logger_name
|
109
111
|
end
|
110
112
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: logging
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.9.
|
4
|
+
version: 0.9.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tim Pease
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2009-
|
12
|
+
date: 2009-02-02 00:00:00 -07:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
@@ -40,7 +40,7 @@ dependencies:
|
|
40
40
|
requirements:
|
41
41
|
- - ">="
|
42
42
|
- !ruby/object:Gem::Version
|
43
|
-
version: 2.
|
43
|
+
version: 2.4.0
|
44
44
|
version:
|
45
45
|
description: Logging is a flexible logging library for use in Ruby programs based on the design of Java's log4j library. It features a hierarchical logging system, custom level names, multiple output destinations per log event, custom formatting, and more.
|
46
46
|
email: tim.pease@gmail.com
|