Merge pull request #157 from str4d/156-disable-logging-by-default

rage: Disable log output by default
This commit is contained in:
str4d 2020-12-04 00:35:53 +00:00 committed by GitHub
commit c5c23d67bb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 20 additions and 3 deletions

View file

@ -9,6 +9,11 @@ and this project adheres to Rust's notion of
to 1.0.0 are beta releases.
## [Unreleased]
### Fixed
- Log output is now disabled by default, to prevent non-fatal error messages
(such as an unset or invalid `LANG` variable) being printed to stderr while
the program succeeds (which is confusing for users). The previous behaviour
can be configured by setting the environment variable `RUST_LOG=error`.
## [0.5.0] - 2020-11-22
### Added

View file

@ -41,7 +41,11 @@ struct AgeOptions {
}
fn main() {
env_logger::builder().format_timestamp(None).init();
env_logger::builder()
.format_timestamp(None)
.filter_level(log::LevelFilter::Off)
.parse_default_env()
.init();
let requested_languages = DesktopLanguageRequester::requested_languages();
i18n_embed::select(&*LANGUAGE_LOADER, &TRANSLATIONS, &requested_languages).unwrap();

View file

@ -199,7 +199,11 @@ fn mount_stream(
fn main() -> Result<(), Error> {
use std::env::args;
env_logger::builder().format_timestamp(None).init();
env_logger::builder()
.format_timestamp(None)
.filter_level(log::LevelFilter::Off)
.parse_default_env()
.init();
let requested_languages = DesktopLanguageRequester::requested_languages();
i18n_embed::select(&*LANGUAGE_LOADER, &TRANSLATIONS, &requested_languages).unwrap();

View file

@ -403,7 +403,11 @@ fn decrypt(opts: AgeOptions) -> Result<(), error::DecryptError> {
fn main() -> Result<(), error::Error> {
use std::env::args;
env_logger::builder().format_timestamp(None).init();
env_logger::builder()
.format_timestamp(None)
.filter_level(log::LevelFilter::Off)
.parse_default_env()
.init();
let requested_languages = DesktopLanguageRequester::requested_languages();
i18n_embed::select(&*LANGUAGE_LOADER, &TRANSLATIONS, &requested_languages).unwrap();