Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set formatter on all broadcasted loggers #1361

Merged
merged 1 commit into from
Dec 31, 2024
Merged

Conversation

unflxw
Copy link
Contributor

@unflxw unflxw commented Dec 30, 2024

When a formatter is set for the broadcast logger, also set that same formatter for all the loggers that it broadcasts to.

Before this change, the already-formatted message would be passed on to the broadcasted loggers, which would format it once again.

This issue was masked by the tests matching the resulting log line using a_string_starting_with, which I introduced in #1351 to smooth out differences between our custom instrumentation of tagged logging, since removed, and that of ActiveSupport::TaggedLogging. Ensure all matching is done against specific strings.

Fixes issue #1360, in which the twice-applied formatting causes additional newlines to appear in the message emitted by the broadcasted loggers.

When a formatter is set for the broadcast logger, also set that same
formatter for all the loggers that it broadcasts to.

Before this change, the already-formatted message would be passed on
to the broadcasted loggers, which would format it once again.

This issue was masked by the tests matching the resulting log line
using `a_string_starting_with`, which I introduced in #1351 to smooth
out differences between our custom instrumentation of tagged logging,
since removed, and that of `ActiveSupport::TaggedLogging`. Ensure all
matching is done against specific strings.

Fixes issue #1360, in which the twice-applied formatting causes
additional newlines to appear in the message emitted by the
broadcasted loggers.
@unflxw unflxw added the bug label Dec 30, 2024
@unflxw unflxw self-assigned this Dec 30, 2024
@unflxw unflxw merged commit 8b5c740 into main Dec 31, 2024
151 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants