diff options
author | Terence Lee <hone02@gmail.com> | 2013-03-15 04:07:22 -0700 |
---|---|---|
committer | Terence Lee <hone02@gmail.com> | 2013-03-15 10:05:10 -0700 |
commit | b7d9d6e2cd5082d269dafbc0316e2107febe1451 (patch) | |
tree | 11766be91ed229cf8bd409f86f2022dd698a560d /activesupport/test | |
parent | b601399b72ab56cc01368f02615af99f45d14f02 (diff) | |
download | rails-b7d9d6e2cd5082d269dafbc0316e2107febe1451.tar.gz rails-b7d9d6e2cd5082d269dafbc0316e2107febe1451.tar.bz2 rails-b7d9d6e2cd5082d269dafbc0316e2107febe1451.zip |
make new rails apps log to STDOUT
Diffstat (limited to 'activesupport/test')
-rw-r--r-- | activesupport/test/tagged_logging_test.rb | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/activesupport/test/tagged_logging_test.rb b/activesupport/test/tagged_logging_test.rb index 27f629474e..0f5b2cba8f 100644 --- a/activesupport/test/tagged_logging_test.rb +++ b/activesupport/test/tagged_logging_test.rb @@ -22,6 +22,17 @@ class TaggedLoggingTest < ActiveSupport::TestCase assert logger.formatter.respond_to?(:tagged) end + test 'creates a tagged logger with the appropriate level and formatter' do + stringio = StringIO.new + logger = ActiveSupport::TaggedLogging.create(stringio, ActiveSupport::Logger::SimpleFormatter.new, :debug) + logger.debug("foo") + + assert_not_nil logger.formatter + assert logger.formatter.respond_to?(:tagged) + assert_equal 0, logger.level + assert stringio.string.include?("foo") + end + test "tagged once" do @logger.tagged("BCX") { @logger.info "Funky time" } assert_equal "[BCX] Funky time\n", @output.string |