Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Comparing changes

Choose two branches to see what's changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
  • 4 commits
  • 6 files changed
  • 0 commit comments
  • 1 contributor
Commits on Apr 04, 2012
@TwP Adding an option to disable the logging configuration display.
There is now an option added to the environment configuration to disable
display of the logging configuration on startup. It is enabled by default in
development mode and disabled by default in production mode.
4d48210
@TwP Fixing version dependency on the Logging gem eef8e44
@TwP version bump for release 996290b
@TwP updating history in preparation for release c4426a6
View
9 History.txt
@@ -1,3 +1,12 @@
+== 0.4.0 / 2012-04-04
+
+Enhancements
+- Compatibility with Ruby 1.8.7 [issue #2]
+- Showing logging configuration is now optional
+
+Bug Fixes
+- Update "logging" depedency to any 1.X gem release
+
== 0.3.0 / 2011-09-19
Enhancements
View
13 README.md
@@ -63,8 +63,9 @@ Logging.logger['UserController'].level = :debug
```
When using the logging railtie, a small display of the current logging
-configuration will be displayed when the Rails logger is in the debug mode.
-A description of the display can be found [here](https://github.com/TwP/logging/blob/master/lib/logging.rb#L400).
+configuration will be displayed when Rails is in development mode
+(environment). A description of the display can be found
+[here](https://github.com/TwP/logging/blob/master/lib/logging.rb#L400).
```
root ............................................ *debug -T
@@ -79,11 +80,11 @@ root ............................................ *debug -T
```
This is useful for understanding more complex logging configurations. It can
-be annoying in day-to-day usage. The soluation is to set the Rails logger to
-```:info``` or higher.
+be annoying in day-to-day usage. To disable, set the ```show_log_configuration```
+setting to false in the environment specific configuration file.
```ruby
-Logging.logger['Rails'].level = :info
+config.show_log_configuration = false
```
Author
@@ -100,7 +101,7 @@ License
The MIT License
-Copyright © 2011 by Tim Pease
+Copyright © 2011-2012 by Tim Pease
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
View
2  Rakefile
@@ -15,6 +15,6 @@ Bones {
use_gmail
- depend_on 'logging', '~> 1.6.1'
+ depend_on 'logging', '~> 1.6'
}
View
6 lib/logging/rails/generators/install_generator.rb
@@ -14,6 +14,12 @@ def insert_log_to_destinations
insert_into_file 'config/environments/development.rb', comment % 'config.log_to = %w[stdout file]', :before => %r/^end\s*$/
insert_into_file 'config/environments/production.rb', comment % 'config.log_to = %w[file]', :before => %r/^end\s*$/
end
+
+ def insert_show_log_configuration
+ comment = "\n # Show the logging configuration on STDOUT\n config.show_log_configuration = %s\n"
+ insert_into_file 'config/environments/development.rb', comment % 'true', :before => %r/^end\s*$/
+ insert_into_file 'config/environments/production.rb', comment % 'false', :before => %r/^end\s*$/
+ end
end
end
end
View
7 lib/logging/rails/railtie.rb
@@ -12,6 +12,7 @@ class Railtie < ::Rails::Railtie
config.before_configuration do
config.log_to = %w[file]
+ config.show_log_configuration = false
end
initializer 'logging.configure', :before => 'initialize_logger' do |app|
@@ -44,8 +45,10 @@ class Railtie < ::Rails::Railtie
::Rails.cache.logger = ::Logging::Logger[::Rails.cache]
end
- config.after_initialize do
- ::Logging.show_configuration if ::Logging::Logger[::Rails].debug?
+ config.after_initialize do |app|
+ if app.config.show_log_configuration and (STDIN.tty? or defined?(Rails::Console))
+ ::Logging.show_configuration(STDERR)
+ end
end
end # Railtie
View
2  version.txt
@@ -1 +1 @@
-0.3.0
+0.4.0

No commit comments for this range

Something went wrong with that request. Please try again.