Skip to content

Instantly share code, notes, and snippets.

@ruckus-matte
Created November 17, 2011 22:59
Show Gist options
  • Save ruckus-matte/1374849 to your computer and use it in GitHub Desktop.
Save ruckus-matte/1374849 to your computer and use it in GitHub Desktop.
autotest error with Logging gem
➔  bundle exec rake
root  ............................................  *debug      -T
- <Appenders::RollingFile:0x8134831c name="file">
  ActionController::Base  ........................   debug  +A  -T
  ActiveRecord::Base  ............................   debug  +A  -T
  ActiveSupport::Cache::FileStore  ...............   debug  +A  -T
  ActiveSupport::Dependencies  ...................   debug  +A  -T
  Logging  .......................................    *off  -A  -T
  Rails  .........................................   debug  +A  -T
DEBUG  Logging : undef :format_date if method_defined? :format_date
def format_date( time )
time.strftime '%Y-%m-%d %H:%M:%S'
end

DEBUG  Logging : undef :format if method_defined? :format
def format( event )
sprintf("[%s] %-5s %s : %s\n", format_date(event.time), ::Logging::LNAMES[event.level], event.logger, format_obj(event.data))
end

DEBUG  Logging : undef :format_date if method_defined? :format_date
def format_date( time )
time.strftime '%Y-%m-%d %H:%M:%S'
end

DEBUG  Logging : undef :format if method_defined? :format
def format( event )
sprintf("[%s] %s %s : %s\n", format_date(event.time), @name_map_0[event.level], event.logger, format_obj(event.data))
end

root  ............................................  *debug      -T
- <Appenders::RollingFile:0x80e2bc94 name="file">
  ActionController::Base  ........................   debug  +A  -T
  ActionMailer::Base  ............................   debug  +A  -T
  ActiveRecord::Base  ............................   debug  +A  -T
  ActiveSupport::Cache::FileStore  ...............   debug  +A  -T
  ActiveSupport::Dependencies  ...................   debug  +A  -T
  Logging  .......................................  *debug  -A  -T
  - <Appenders::Stderr:0x8137a858 name="stderr">
  Rails  .........................................   debug  +A  -T
  User  ..........................................   debug  +A  -T
Run options: 

# Running tests:

..........................................................................................

Finished tests in 1.888349s, 47.6607 tests/s, 46.6016 assertions/s.

90 tests, 88 assertions, 0 failures, 0 errors, 0 skips
==============================================================================

 INFO  Logging : shutdown called - closing all appenders
DEBUG  Logging : undef :format_date if method_defined? :format_date
def format_date( time )
time.strftime '%Y-%m-%d %H:%M:%S'
end

DEBUG  Logging : undef :format if method_defined? :format
def format( event )
sprintf("[%s] %-5s %s : %s\n", format_date(event.time), ::Logging::LNAMES[event.level], event.logger, format_obj(event.data))
end

DEBUG  Logging : undef :format_date if method_defined? :format_date
def format_date( time )
time.strftime '%Y-%m-%d %H:%M:%S'
end

DEBUG  Logging : undef :format if method_defined? :format
def format( event )
sprintf("[%s] %s %s : %s\n", format_date(event.time), @name_map_0[event.level], event.logger, format_obj(event.data))
end

root  ............................................  *debug      -T
- <Appenders::RollingFile:0x81134f44 name="file">
  ActionController::Base  ........................   debug  +A  -T
  ActionMailer::Base  ............................   debug  +A  -T
  ActiveRecord::Base  ............................   debug  +A  -T
  ActiveSupport::Cache::FileStore  ...............   debug  +A  -T
  ActiveSupport::Dependencies  ...................   debug  +A  -T
  Logging  .......................................  *debug  -A  -T
  - <Appenders::Stderr:0x81a0595c name="stderr">
  Rails  .........................................   debug  +A  -T
  User  ..........................................   debug  +A  -T
Run options: 

# Running tests:

...........................................................................................................

Finished tests in 2.714828s, 39.4132 tests/s, 48.9902 assertions/s.

107 tests, 133 assertions, 0 failures, 0 errors, 0 skips
==============================================================================

 INFO  Logging : shutdown called - closing all appenders
RuntimeError: appender '<Logging::Appenders::RollingFile: file>' is closed
/Users/matte/.rvm/gems/ruby-1.9.3-p0@rails3licensing/gems/logging-1.6.1/lib/logging/appender.rb:66:in `append'
/Users/matte/.rvm/gems/ruby-1.9.3-p0@rails3licensing/gems/logging-1.6.1/lib/logging/logger.rb:400:in `block in log_event'
/Users/matte/.rvm/gems/ruby-1.9.3-p0@rails3licensing/gems/logging-1.6.1/lib/logging/logger.rb:400:in `each'
/Users/matte/.rvm/gems/ruby-1.9.3-p0@rails3licensing/gems/logging-1.6.1/lib/logging/logger.rb:400:in `log_event'
/Users/matte/.rvm/gems/ruby-1.9.3-p0@rails3licensing/gems/logging-1.6.1/lib/logging/logger.rb:401:in `log_event'
/Users/matte/.rvm/gems/ruby-1.9.3-p0@rails3licensing/gems/logging-1.6.1/lib/logging/logger.rb:124:in `info'
/Users/matte/projects/git/licensing/lib/test_extensions.rb:13:in `log_test'
/Users/matte/.rvm/gems/ruby-1.9.3-p0@rails3licensing/gems/activesupport-3.0.10/lib/active_support/callbacks.rb:420:in `_run_setup_callbacks'
/Users/matte/.rvm/gems/ruby-1.9.3-p0@rails3licensing/gems/activesupport-3.0.10/lib/active_support/testing/setup_and_teardown.rb:34:in `run'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment