Browse files

Moved all the logger methods to active support logger

minor
  • Loading branch information...
1 parent f63fff6 commit 00236435221a39441af3f1e76110767fba4154a8 @Karunakar Karunakar committed Jan 5, 2012
View
2 actionpack/README.rdoc
@@ -206,7 +206,7 @@ A short rundown of some of the major features:
You specify a logger through a class method, such as:
- ActionController::Base.logger = Logger.new("Application Log")
+ ActionController::Base.logger = ActiveSupport::Logger.new("Application Log")
ActionController::Base.logger = Log4r::Logger.new("Application Log")
View
2 actionpack/test/controller/content_type_test.rb
@@ -59,7 +59,7 @@ def setup
super
# enable a logger so that (e.g.) the benchmarking stuff runs, so we can get
# a more accurate simulation of what happens in "real life".
- @controller.logger = Logger.new(nil)
+ @controller.logger = ActiveSupport::Logger.new(nil)
end
# :ported:
View
2 actionpack/test/controller/new_base/render_streaming_test.rb
@@ -85,7 +85,7 @@ class StreamingTest < Rack::TestCase
test "rendering with template exception logs the exception" do
io = StringIO.new
- _old, ActionController::Base.logger = ActionController::Base.logger, Logger.new(io)
+ _old, ActionController::Base.logger = ActionController::Base.logger, ActiveSupport::Logger.new(io)
begin
get "/render_streaming/basic/template_exception"
View
4 actionpack/test/controller/render_test.rb
@@ -696,7 +696,7 @@ def setup
# enable a logger so that (e.g.) the benchmarking stuff runs, so we can get
# a more accurate simulation of what happens in "real life".
super
- @controller.logger = Logger.new(nil)
+ @controller.logger = ActiveSupport::Logger.new(nil)
@request.host = "www.nextangle.com"
end
@@ -907,7 +907,7 @@ def test_access_to_request_in_view
def test_access_to_logger_in_view
get :accessing_logger_in_template
- assert_equal "Logger", @response.body
+ assert_equal "ActiveSupport::Logger", @response.body
end
# :ported:
View
2 actionpack/test/controller/render_xml_test.rb
@@ -48,7 +48,7 @@ def setup
# enable a logger so that (e.g.) the benchmarking stuff runs, so we can get
# a more accurate simulation of what happens in "real life".
super
- @controller.logger = Logger.new(nil)
+ @controller.logger = ActiveSupport::Logger.new(nil)
@request.host = "www.nextangle.com"
end
View
2 actionpack/test/dispatch/request/json_params_parsing_test.rb
@@ -34,7 +34,7 @@ def teardown
with_test_routing do
output = StringIO.new
json = "[\"person]\": {\"name\": \"David\"}}"
- post "/parse", json, {'CONTENT_TYPE' => 'application/json', 'action_dispatch.show_exceptions' => true, 'action_dispatch.logger' => Logger.new(output)}
+ post "/parse", json, {'CONTENT_TYPE' => 'application/json', 'action_dispatch.show_exceptions' => true, 'action_dispatch.logger' => ActiveSupport::Logger.new(output)}
assert_response :error
output.rewind && err = output.read
assert err =~ /Error occurred while parsing request parameters/
View
2 actionpack/test/dispatch/request/xml_params_parsing_test.rb
@@ -56,7 +56,7 @@ def call(env)
with_test_routing do
output = StringIO.new
xml = "<person><name>David</name><avatar type='file' name='me.jpg' content_type='image/jpg'>#{::Base64.encode64('ABC')}</avatar></pineapple>"
- post "/parse", xml, default_headers.merge('action_dispatch.show_exceptions' => true, 'action_dispatch.logger' => Logger.new(output))
+ post "/parse", xml, default_headers.merge('action_dispatch.show_exceptions' => true, 'action_dispatch.logger' => ActiveSupport::Logger.new(output))
assert_response :error
output.rewind && err = output.read
assert err =~ /Error occurred while parsing request parameters/
View
2 actionpack/test/template/template_test.rb
@@ -37,7 +37,7 @@ def lookup_context
end
def logger
- Logger.new(STDERR)
+ ActiveSupport::Logger.new(STDERR)
end
def my_buffer
View
2 activerecord/README.rdoc
@@ -143,7 +143,7 @@ A short rundown of some of the major features:
* Logging support for Log4r[http://log4r.sourceforge.net] and Logger[http://www.ruby-doc.org/stdlib/libdoc/logger/rdoc].
- ActiveRecord::Base.logger = Logger.new(STDOUT)
+ ActiveRecord::Base.logger = ActiveSupport::Logger.new(STDOUT)
ActiveRecord::Base.logger = Log4r::Logger.new("Application Log")
View
2 activerecord/lib/active_record/railtie.rb
@@ -38,7 +38,7 @@ class Railtie < Rails::Railtie
# first time. Also, make it output to STDERR.
console do |app|
require "active_record/railties/console_sandbox" if app.sandbox?
- ActiveRecord::Base.logger = Logger.new(STDERR)
+ ActiveRecord::Base.logger = ActiveSupport::Logger.new(STDERR)
end
initializer "active_record.initialize_timezone" do
View
5 activeresource/test/abstract_unit.rb
@@ -7,11 +7,10 @@
require 'active_resource'
require 'active_support'
require 'active_support/test_case'
-
require 'setter_trap'
+require 'active_support/logger'
-require 'logger'
-ActiveResource::Base.logger = Logger.new("#{File.dirname(__FILE__)}/debug.log")
+ActiveResource::Base.logger = ActiveSupport::Logger.new("#{File.dirname(__FILE__)}/debug.log")
def setup_response
matz_hash = { 'person' => { :id => 1, :name => 'Matz' } }
View
1 activesupport/test/buffered_logger_test.rb
@@ -3,7 +3,6 @@
require 'stringio'
require 'fileutils'
require 'tempfile'
-require 'active_support/buffered_logger'
require 'active_support/testing/deprecation'
class BufferedLoggerTest < Test::Unit::TestCase
View
4 activesupport/test/caching_test.rb
@@ -681,7 +681,7 @@ def setup
@data = @cache.instance_variable_get(:@data)
@cache.clear
@cache.silence!
- @cache.logger = Logger.new("/dev/null")
+ @cache.logger = ActiveSupport::Logger.new("/dev/null")
end
include CacheStoreBehavior
@@ -786,7 +786,7 @@ def setup
@cache = ActiveSupport::Cache.lookup_store(:memory_store)
@buffer = StringIO.new
- @cache.logger = Logger.new(@buffer)
+ @cache.logger = ActiveSupport::Logger.new(@buffer)
end
def test_logging

0 comments on commit 0023643

Please sign in to comment.