mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Add a regression test for per-fiber tagged logging
Followup to 978421abd83d45b72e299f50a4fb324fcbdb3e00.
This commit is contained in:
parent
c3913e580c
commit
19d8578361
1 changed files with 9 additions and 0 deletions
|
@ -83,6 +83,15 @@ class TaggedLoggingTest < ActiveSupport::TestCase
|
||||||
assert_equal "Dull story\n[OMG] Cool story\n[BCX] Funky time\n", @output.string
|
assert_equal "Dull story\n[OMG] Cool story\n[BCX] Funky time\n", @output.string
|
||||||
end
|
end
|
||||||
|
|
||||||
|
test "keeps each tag in their own thread even when pushed directly" do
|
||||||
|
Thread.new do
|
||||||
|
@logger.push_tags("OMG")
|
||||||
|
@logger.info "Cool story"
|
||||||
|
end.join
|
||||||
|
@logger.info "Funky time"
|
||||||
|
assert_equal "[OMG] Cool story\nFunky time\n", @output.string
|
||||||
|
end
|
||||||
|
|
||||||
test "keeps each tag in their own instance" do
|
test "keeps each tag in their own instance" do
|
||||||
other_output = StringIO.new
|
other_output = StringIO.new
|
||||||
other_logger = ActiveSupport::TaggedLogging.new(MyLogger.new(other_output))
|
other_logger = ActiveSupport::TaggedLogging.new(MyLogger.new(other_output))
|
||||||
|
|
Loading…
Reference in a new issue