logging 0.9.5 → 0.9.6

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,3 +1,9 @@
1
+ == 0.9.6 / 2009-02-02
2
+
3
+ 2 minor enhancements
4
+ - Ruby 1.9.1 compatability
5
+ - JRuby 1.1.5 compatability
6
+
1
7
  == 0.9.5 / 2009-01-25
2
8
 
3
9
  2 minor enhancements
data/Rakefile CHANGED
@@ -34,6 +34,7 @@ PROJ.rdoc.remote_dir = ''
34
34
 
35
35
  PROJ.ann.email[:server] = 'smtp.gmail.com'
36
36
  PROJ.ann.email[:port] = 587
37
+ PROJ.ann.email[:from] = 'Tim Pease'
37
38
 
38
39
  depend_on 'flexmock'
39
40
  depend_on 'lockfile'
@@ -17,7 +17,7 @@ begin require 'fastthread'; rescue LoadError; end
17
17
  module Logging
18
18
 
19
19
  # :stopdoc:
20
- VERSION = '0.9.5'
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 2>&1 > /dev/null')
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
@@ -133,7 +133,7 @@ module Logging::Config
133
133
  alias :__instance_eval :instance_eval
134
134
 
135
135
  instance_methods.each do |m|
136
- undef_method m unless m[%r/^__/]
136
+ undef_method m unless m[%r/^(__|object_id)/]
137
137
  end
138
138
 
139
139
  def self.process( &block )
@@ -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[2]
35
+ t = Kernel.caller[CALLER_INDEX]
34
36
  return if t.nil?
35
37
 
36
38
  m = CALLER_RGXP.match(t)
@@ -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
@@ -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"
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-25}
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.2"])
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.0"])
30
+ s.add_development_dependency(%q<bones>, [">= 2.3.1"])
31
31
  else
32
- s.add_dependency(%q<flexmock>, [">= 0.8.2"])
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.0"])
34
+ s.add_dependency(%q<bones>, [">= 2.3.1"])
35
35
  end
36
36
  else
37
- s.add_dependency(%q<flexmock>, [">= 0.8.2"])
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.0"])
39
+ s.add_dependency(%q<bones>, [">= 2.3.1"])
40
40
  end
41
41
  end
@@ -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 = File.readlines(PROJ.ignore_file).map do |line|
265
+ ary = []
266
+ File.readlines(PROJ.ignore_file).each do |line|
266
267
  next if line =~ comment
267
- line.chomp.strip
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 => ::Syslog::LOG_PERROR | ::Syslog::LOG_NDELAY,
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 => ::Syslog::LOG_PERROR | ::Syslog::LOG_NDELAY,
177
+ :logopt => @logopt,
175
178
  :facility => ::Syslog::LOG_USER,
176
179
  :layout => layout
177
180
  )
@@ -45,7 +45,12 @@ module LoggingTestCase
45
45
  @__instance__ = nil
46
46
  class << self
47
47
  nonce = class << Singleton; self; end
48
- define_method(:instance, nonce::FirstInstanceCall)
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
@@ -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
- assert_equal '', c.name
93
+ # assert_equal '', c.name
92
94
  assert_equal 'Array', c.logger_name
93
95
 
94
96
  meta = class << Array; self; end
95
- assert_equal '', meta.name
97
+ # assert_equal '', meta.name
96
98
  assert_equal 'Array', meta.logger_name
97
99
 
98
100
  m = Module.new
99
- assert_equal '', m.name
101
+ # assert_equal '', m.name
100
102
  assert_equal 'anonymous', m.logger_name
101
103
 
102
104
  c = Class.new(::Logging::Logger)
103
- assert_equal '', c.name
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
- assert_equal '', meta.name
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.5
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-01-25 00:00:00 -07:00
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.3.0
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