-
Notifications
You must be signed in to change notification settings - Fork 35
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
fix: if tracing is enabled, use if for logging too #48
Conversation
That's a firm no-no. Features should be additive. Perhaps if everything is transparently funneled through |
3a2351e
to
f746a54
Compare
Ok, so I reworked it in a way that:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Core attribute logic this seems fine to me now, thanks! Please revert spurious formatting changes, though. Also, can you please create a separate pull request for the ansi
feature addition? This will require enabling of color for env_logger
as well, so that both are colored by default. Right now we get colored logs when both features are enabled and uncolored when only log
is active.
That was applied by |
f746a54
to
aeccd3e
Compare
Ok, this PR should now only contain the trace-logging stuff. |
Thank you! |
Add a CHANGELOG entry for #48, which enabled the tracing-subscriber's tracing-log feature to unify log output if both the 'log' and 'trace' feature are enabled.
When having crates which use
tracing
andlog
and have thetracing
feature enabled, you'll get mixed log formats on the output:This was due to the fact that we enabled the
trace
feature, but did not disable thedefault
(and thus thelog
) feature. Having both enabled, will also enable both frameworks, one for logging, one for tracing.Disabling the
log
feature however removes thelog
output.I think the correct fix would be to enable the
tracing-subscriber/tracing-log
feature, which captures bothlog
andtracing
events, streaming both thetracing
system, giving a consolidated format.This would make the
log
andtrace
feature mutually exclusive.