-
Notifications
You must be signed in to change notification settings - Fork 340
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
devenv: convert logging to use tracing
ecosystem
#1566
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sandydoo
force-pushed
the
migrate-logging
branch
from
November 1, 2024 11:51
fac3f42
to
1a0148d
Compare
sandydoo
force-pushed
the
migrate-logging
branch
from
November 8, 2024 16:47
1a0148d
to
8b0c37e
Compare
Deploying devenv with Cloudflare Pages
|
sandydoo
force-pushed
the
migrate-logging
branch
from
November 14, 2024 23:34
1344616
to
925cae0
Compare
sandydoo
force-pushed
the
migrate-logging
branch
from
November 26, 2024 01:50
925cae0
to
6f2f04c
Compare
domenkozar
requested changes
Nov 27, 2024
sandydoo
force-pushed
the
migrate-logging
branch
2 times, most recently
from
November 27, 2024 15:47
b659346
to
7341a94
Compare
[skip ci]
[skip ci]
Also make sure to print out non-user messages.
sandydoo
force-pushed
the
migrate-logging
branch
from
November 28, 2024 20:20
e884920
to
d9fff24
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Converts devenv to use the tracing ecosystem for logging.
Usage
You can now use tracing macros to output events:
debug!
,info!
,error!
, etc.Adding a
devenv.is_user_message
boolean field to the event formats it as a step.Steps can also be created with spans:
info_span!
,error_span!
, etc.Adding a
devenv.user_message = "..."
field to the span makes it output events for the start and end of the span.The latter also outputs timings.
RUST_LOG
Logging can be additionally configured using the
RUST_LOG
environment variable.Logging formats
devenv supports two log formats via the
--log-format
option:cli
andtracing-full
.--log-format cli
The default. Mimics the existing CLI logging format.
--log-format tracing-full
Outputs traces in the tracing library's
Full
style. Useful in conjunction with the--verbose
flag to debug issues.--verbose
drops the log level to debug and outputs all Nix logs.Introduces:
DevenvLayer
tracing layer that tracks metadata about spans. This tracks span timings, errors, and emits events when the span is created and closed.DevenvFormat
event formatter that mimics the existing CLI formatting.