From c9770d8a5ac1c477943ba431396e5d7e6b7389b0 Mon Sep 17 00:00:00 2001 From: Michael Koziarski Date: Sun, 25 Feb 2007 00:07:54 +0000 Subject: 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 --- activesupport/test/clean_logger_test.rb | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'activesupport/test/clean_logger_test.rb') 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 -- cgit v1.2.3