aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/test/clean_logger_test.rb
diff options
context:
space:
mode:
authorMichael Koziarski <michael@koziarski.com>2007-02-25 00:07:54 +0000
committerMichael Koziarski <michael@koziarski.com>2007-02-25 00:07:54 +0000
commitc9770d8a5ac1c477943ba431396e5d7e6b7389b0 (patch)
tree5175761088d89a021dea8da2c1a405215afca444 /activesupport/test/clean_logger_test.rb
parentad9bacb189e82816bf333cdbae329f199a171c9f (diff)
downloadrails-c9770d8a5ac1c477943ba431396e5d7e6b7389b0.tar.gz
rails-c9770d8a5ac1c477943ba431396e5d7e6b7389b0.tar.bz2
rails-c9770d8a5ac1c477943ba431396e5d7e6b7389b0.zip
Allow users to provide custom formatters to Logger. [aeden] Closes #7106, #2484
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6225 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'activesupport/test/clean_logger_test.rb')
-rw-r--r--activesupport/test/clean_logger_test.rb7
1 files changed, 7 insertions, 0 deletions
diff --git a/activesupport/test/clean_logger_test.rb b/activesupport/test/clean_logger_test.rb
index a15bfbca3b..ce48107242 100644
--- a/activesupport/test/clean_logger_test.rb
+++ b/activesupport/test/clean_logger_test.rb
@@ -40,6 +40,13 @@ class CleanLoggerTest < Test::Unit::TestCase
assert_equal "error\nfatal\nerror\nfatal\nunsilenced\n", @out.string
end
+
+ def test_datetime_format
+ @logger.formatter = Logger::Formatter.new
+ @logger.datetime_format = "%Y-%m-%d"
+ @logger.debug 'debug'
+ assert_match(/D, \[\d\d\d\d-\d\d-\d\d#\d+\] DEBUG -- : debug/, @out.string)
+ end
end
class CleanLogger_182_to_183_Test < Test::Unit::TestCase