Add a regression test for per-fiber tagged logging
Followup to 978421abd83d45b72e299f50a4fb324fcbdb3e00.
This commit is contained in:
parent
c3913e580c
commit
19d8578361
@ -83,6 +83,15 @@ def flush(*)
|
||||
assert_equal "Dull story\n[OMG] Cool story\n[BCX] Funky time\n", @output.string
|
||||
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
|
||||
other_output = StringIO.new
|
||||
other_logger = ActiveSupport::TaggedLogging.new(MyLogger.new(other_output))
|
||||
|
Loading…
Reference in New Issue
Block a user