diff options
author | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2015-01-02 19:55:29 -0300 |
---|---|---|
committer | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2015-01-02 19:55:29 -0300 |
commit | eed68fddee6477ce1e8365d2b495310ef4903621 (patch) | |
tree | ad2e9b5f76b3e359abb98cc44bb57505cb3d3fbe /activesupport/test | |
parent | 734d97d292b4f04c13f03625e07f2888e88b0649 (diff) | |
parent | 7cd0b7982520e410494e834edaa9be855d2920ad (diff) | |
download | rails-eed68fddee6477ce1e8365d2b495310ef4903621.tar.gz rails-eed68fddee6477ce1e8365d2b495310ef4903621.tar.bz2 rails-eed68fddee6477ce1e8365d2b495310ef4903621.zip |
Merge pull request #9065 from atombender/master
Fix TaggedLogging to allow loggers to be instantiated multiple times without having to share the stack of tags
Diffstat (limited to 'activesupport/test')
-rw-r--r-- | activesupport/test/tagged_logging_test.rb | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/activesupport/test/tagged_logging_test.rb b/activesupport/test/tagged_logging_test.rb index 27f629474e..03a63e94e8 100644 --- a/activesupport/test/tagged_logging_test.rb +++ b/activesupport/test/tagged_logging_test.rb @@ -79,6 +79,19 @@ class TaggedLoggingTest < ActiveSupport::TestCase assert_equal "[OMG] Cool story bro\n[BCX] Funky time\n", @output.string end + test "keeps each tag in their own instance" do + @other_output = StringIO.new + @other_logger = ActiveSupport::TaggedLogging.new(MyLogger.new(@other_output)) + @logger.tagged("OMG") do + @other_logger.tagged("BCX") do + @logger.info "Cool story bro" + @other_logger.info "Funky time" + end + end + assert_equal "[OMG] Cool story bro\n", @output.string + assert_equal "[BCX] Funky time\n", @other_output.string + end + test "cleans up the taggings on flush" do @logger.tagged("BCX") do Thread.new do |