-
Notifications
You must be signed in to change notification settings - Fork 1
Update Rust crate env_logger to 0.11 #5
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
Open
renovate
wants to merge
1
commit into
master
Choose a base branch
from
renovate/env_logger-0.x
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains hidden or 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
7bc1cfb to
50960b9
Compare
4989c06 to
7b2538d
Compare
7b2538d to
edf0e28
Compare
edf0e28 to
7457daf
Compare
7457daf to
d971712
Compare
9e2feb6 to
9111559
Compare
9111559 to
db6c49b
Compare
a628738 to
f7a41ec
Compare
f7a41ec to
d244898
Compare
d244898 to
d232c4a
Compare
d232c4a to
f0c0b95
Compare
f0c0b95 to
982939c
Compare
982939c to
47edd28
Compare
47edd28 to
b94f667
Compare
b94f667 to
64623ec
Compare
64623ec to
283a2af
Compare
283a2af to
a8f9bf1
Compare
a8f9bf1 to
b9a4938
Compare
916310e to
f20675f
Compare
be542c4 to
5d3cfbf
Compare
0c00982 to
da6905e
Compare
da6905e to
05dce5d
Compare
05dce5d to
5684efa
Compare
5684efa to
ec2e999
Compare
78f2977 to
a09bedf
Compare
2b2d5bf to
e793935
Compare
29d022c to
63b2748
Compare
b29face to
13027f4
Compare
13027f4 to
a449ee9
Compare
a449ee9 to
8141817
Compare
125419a to
50cdea5
Compare
92f0dc8 to
ae9e5ac
Compare
b788d6a to
90e1299
Compare
90e1299 to
5d4963d
Compare
dbda58c to
f30e8b0
Compare
d5f6433 to
65f6629
Compare
65f6629 to
71b21f8
Compare
71b21f8 to
32e506d
Compare
32e506d to
9854005
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.
This PR contains the following updates:
0.3->0.11Release Notes
rust-cli/env_logger (env_logger)
v0.11.8Compare Source
Compatibility
unstable-kvfeature which may be removed in a future patch releaseFeatures
kvfeatureConfigurableFormatto build custom [Builder::format]s that leverage thisv0.11.7Compare Source
Internal
humantimewithjiffv0.11.6Compare Source
Features
v0.11.5Compare Source
v0.11.4Compare Source
v0.11.3Compare Source
Features
unstable-kvv0.11.2Compare Source
v0.11.1Compare Source
Fixes
Target::Pipev0.11.0Compare Source
Migration Guide
env_logger::fmt::Style:
The bespoke styling API, behind
color, was removed, in favor of accepting anyANSI styled string and adapting it to the target stream's capabilities.
Possible styling libraries include:
env_logger::fmt::stylecustom_format.rs
uses
anstyleviaFormatter::default_level_styleBreaking Change
env_logger::fmt::Formatter::styleenv_logger::fmt::Formatter::default_styled_levelenv_logger::fmt::Styleenv_logger::fmt::Colorenv_logger::fmt::StyledValueenv_logger::filterin favor ofenv_filterCompatibility
MSRV changed to 1.71
Features
NO_COLORandCLICOLOR_FORCE, see https://bixense.com/clicolors/Fixes
is_test(true)v0.10.2Compare Source
Performance
Fixes
coloris disabledv0.10.1Compare Source
Performance
Documentation
RUST_LOGdocumentationv0.10.0Compare Source
MSRV changed to 1.60 to hide optional dependencies
Fixes
attytois-terminalBreaking Changes
To open room for changing dependencies:
termcolorfeature tocolorattyfeature toauto-colorv0.9.3Compare Source
v0.9.2Compare Source
v0.9.1Compare Source
v0.9.0Compare Source
Breaking Changes
Improvements
v0.8.4Compare Source
Breaking Changes
Improvements
v0.8.3: 0.8.3Compare Source
New features:
Builder::format_suffix) [#192]Improvements:
Bug fixes:
rust-toolchainwhose presence caused issues for a few people)v0.8.2: 0.8.2Compare Source
Fixed a panic on io errors when writing to stdout / stderr (#184).
v0.8.1: 0.8.1Compare Source
Update links in the documentation that were pointing to the old repository location.
v0.8.0: 0.8.0Compare Source
Breaking changes:
Improvements:
Deprecations:
env_logger::from_envhas been deprecated in favor ofenv_logger::Builder::from_envThis release raises the minimum supported Rust version to 1.41.0.
v0.7.1: 0.7.1Compare Source
Key Changes
Contributions
v0.7.0: 0.7.0Compare Source
Key Changes
Changes to minimum Rust
The minimum version of Rust required has been set at
1.31.0. We may change this in patch versions, but will always flag it in the release notes here.You can always check the
.travis.ymlfile to see the current minimum supported version.Contributions
v0.6.2: 0.6.2Compare Source
Key Changes
Contributions
v0.6.1: 0.6.1Compare Source
Key Changes
cargo teststdoutContributions
More Details
Builder::is_testThe
is_testmethod can be used in tests to make sure logs are captured bycargo testthe same wayprintln!is:There are performance implications of using
is_testthough, so it should be avoided outside of unit tests.v0.6.0: 0.6.0Compare Source
Key Changes
logoptional (but enabled by default)Breaking Changes
log. That means compilingenv_loggerwithdefault-features=falsewill result in a different experience than in0.5.x.Contributions
-Z minimal-versionson CIMore Details
Disabling dependencies
Using
default-features=falsewill disable all dependencies ofenv_loggerbesideslog. This will reduce compile times and alter the default format by disabling colours and timestamps.Disabling default dependencies is the recommended way to use
env_loggerfor libraries that only need it for logging in tests.v0.5.13: 0.5.13Compare Source
Key Changes
Contributions
More Details
Formatter::default_level_styleThe style used in the default format for printing level names can be fetched using the new
default_level_stylemethod on aFormatter. The below example will format just the record message using the style of its level:v0.5.12: 0.5.12Compare Source
Key Changes
Contributions
More Details
Builder::default_format_timestamp_nanosThe
Builder::default_format_timestamp_nanosmethod can be used to toggle the precision of timestamps in the default format. When set totrue, timestamps will include a 6-digit nanosecond component like2018-02-14T00:28:07.000000000Z.Formatter::precise_timestampCustom formats can get a precise timestamp instead of the default by calling the
precise_timestampmethod instead of the existingtimestampone.v0.5.11: 0.5.11Compare Source
Key Changes
termcolorto1.0rustcto1.20.0Changes to minimum Rust
The minimum version of Rust required has been set at
1.20.0. We may change this in patch versions, but will always flag it in the release notes here.You can always check the
.travis.ymlfile to see the current minimum supported version.Contributions
v0.5.10: 0.5.10Compare Source
Key Changes
regexto1.0.Contributions
v0.5.9: 0.5.9Compare Source
Key Changes
Contributions
More Details
filter_moduleandfilter_levelAdds two new methods to
Builderandfilter::Builderthat are specific cases of the existingfiltermethod:filter_moduleadds a directive for the given module. It's the same asfilter(Some(module), level)filter_leveladds a directive for all modules. It's the same asfilter(None, level)v0.5.8: 0.5.8Compare Source
Key Changes
Contributions
More Details
Env::filter_orandEnv::write_style_orDefault values for environment variables can be specified on the
Envtype using thefilter_orandwrite_style_ormethods. The default value is a string in the same format as the environment variable:In usage:
DEFAULT_FILTER_ENVandDEFAULT_WRITE_STYLE_ENVTwo new constants are publicly exported that correspond to the default environment variable names used for the filters and style preferences.
v0.5.7: 0.5.7Compare Source
Contributions
v0.5.6: 0.5.6Compare Source
Key Changes
termcolor::ColorAPI so it's no longer a public dependencyContributions
More Details
This patch fixes an issue that slipped through
0.5.0where thetermcolor::Colortype was re-exported instead of redefined.This is a potentially breaking change
Instead of re-exporting
termcolor::Color, we now redefine the same API inenv_logger. The potential breakage is if anyone was relying on the fact thatenv_logger::Colorandtermcolor::Colorwere equivalent types. This was only obvious from the source, and a survey of public code usingenv_loggerand call for comment hasn't revealed any code relying on this.v0.5.5: 0.5.5Compare Source
Key Changes
Contributions
More Details
Builder::default_format_*The default format can be easily tweaked by conditionally enabling/disabling parts of it in the main
Builder. The API looks like:Calling
default_format_*will store whether or not we want to include those parts of the log, without affecting a custom format. That means:Is the same as:
Setting a custom format won't clobber any values passed to
default_format_*methods. That means:Is the same as:
Builder::from_default_envA new
from_default_envmethod that's a convenient way of callingfrom_env(env_logger::Env::default()).v0.5.4: 0.5.4Compare Source
Key Changes
humantimeinstead ofchronofor formatting timestampsChanges to minimum Rust
The minimum version of Rust required has been set at
1.18.0. We may change this in patch versions, but will always flag it in the release notes here.You can always check the
.travis.ymlfile to see the current minimum supported version.New Dependencies
humantimefor formatting timestamps. This replaces the dependency onchronoContributions
v0.5.3: 0.5.3Compare Source
Key Changes
set_intense(true)to produce a lighter color, andset_intense(false)to produce the default color.Contributions
fmt::Style::set_intensev0.5.2: 0.5.2Compare Source
Key Changes
stdout/stderris a tty and write styles accordingly. This fixes an issue with color control characters showing up logs piped to filesNew Dependencies
attyfor interrogatingstdout/stderrContributions
v0.5.1: 0.5.1Compare Source
Key Changes
Contributions
v0.5.0: 0.5.0Compare Source
NOTE: These release notes are collected from the
0.5.0-rc.1and0.5.0-rc.2release notes.Key Changes
Breaking Changes
LogTargethas been renamed toTargetLogBuilderhas been renamed toBuilderBuilder::formatmethod now accepts aF: Fn(&mut Formatter, &Record) -> Result<()> + Sync + Send. This is the new formatting API that writes into aFormatterinstead of producing an ownedStringBuilder::initwill panic if the logger can't be initialised. A newBuilder::try_initmethod has been added with the same semantics as the oldBuilder::initmethodNew Dependencies
chronofor the timestamptermcolorfor record buffering and colorsContributions
log/ deny debug impls, missing docs, and warnings.Thanks to everybody who helped make this release of
env_loggerhappen!More Details
Disabling colors
Adds a new builder property for whether or not to include colors. By default this is controlled by the
RUST_LOG_STYLEenvironment variable, but it can be overridden.Setting this environment variable to
neverwill disable colors and other styles:$ export RUST_LOG_STYLE=never $ ./my-appValid values are:
auto(or missing/invalid) will decide whether or not the terminal supports colorsalwayswill always use colorsneverwill never use colorsIn order to support multiple environment variables, I've refactored our
from_envfunctions to accept a genericT: Into<Env>, whereEnvis a container for the environment variables we care about. These methods can now be called in a few ways:This lets us add new environment variables in the future without potentially breaking people. But it does mean if you're overriding all environment variables that new ones could slip in without you noticing.
Using alternative environment variables
Since we use two environment variables to configure the logger we need an ergonomic way to pass different combinations of those variables to
from_envmethods. This PR adds anEnvtype with builder methods for naming environment variables:With a few
Fromconversions, the above is also equivalent to:Whether or not we want to keep these conversions is up for discussion.
Writing colors
The color API has been refactored and made public so you can use them in your own formats:
This saves you from having to split the writes into multiple calls and juggle
Resulttypes.Writing timestamps
Call the
timestampmethod on aFormatterto get an opaque timestamp that can be logged. It'll be written in an RFC3339 format:v0.4.3Compare Source
v0.4.2Compare Source
v0.4.1Compare Source
v0.4.0Compare Source
Configuration
📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR is behind base branch, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR was generated by Mend Renovate. View the repository job log.