Skip to content

Commit

Permalink
remove unnecessary colour feature for logger and use local timestamps…
Browse files Browse the repository at this point in the history
… in logging
  • Loading branch information
kwheelans committed Nov 11, 2023
1 parent 67e1048 commit a9bbc25
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 78 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
# v0.4.1
## Changes
- Remove unnecessary colour feature from logging
- Use local timestamps for logging
- Better handling for logger initialization failure

# v0.4.0
## Breaking Changes
- BZip2 not supported.
Expand Down
74 changes: 2 additions & 72 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
[package]
name = "docker-volume-backup"
version = "0.4.0"
version = "0.4.1"
authors = ["Kevin Wheelans <kevin.wheelans@proton.me>"]
edition = "2021"
rust-version = "1.70"
description = ""
description = "Simple volume backup utility for Docker cotnainers"
homepage = "https://github.com/kwheelans/docker-volume-backup"
license = "MIT"
keywords = []
Expand All @@ -14,7 +14,7 @@ repository = "https://github.com/kwheelans/docker-volume-backup"
[dependencies]
log = "0.4"
flate2 = "1"
simple_logger = "4"
simple_logger = { version = "4", default-features = false, features = ["timestamps"]}
tar = "0.4"
time = { version = "0.3", features = ["local-offset", "macros", "formatting"] }
thiserror = "1"
Expand Down
12 changes: 9 additions & 3 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,19 @@ const GROUP_PERMISSION: &str = "GROUP_PERMISSION";
const OTHER_PERMISSION: &str = "OTHER_PERMISSION";

fn main() -> ExitCode {
simple_logger::SimpleLogger::new()
if let Err(error) = simple_logger::SimpleLogger::new()
.with_level(LevelFilter::Off)
.env()
.with_module_level(LOG_TARGET, set_logging_level())
.with_colors(true)
.with_local_timestamps()
.init()
.unwrap();
{
println!(
"ERROR [{}] Unable to initialize logger: {}",
LOG_TARGET, error
);
return ExitCode::FAILURE;
}

if let Err(error) = run() {
error!(target: LOG_TARGET, "{}", error);
Expand Down

0 comments on commit a9bbc25

Please sign in to comment.