Skip to content

Commit

Permalink
Merge pull request hyperledger-archives#167 from Cargill/pschwarz-sim…
Browse files Browse the repository at this point in the history
…ple-logger-utc

Switch simple logger to use UTC timestamps
  • Loading branch information
peterschwarz authored Dec 15, 2021
2 parents 6662f0b + f6057d7 commit f9c1d24
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion tp/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ path = "src/main.rs"
sawtooth-sdk = "0.5"
sabre-sdk = {path = "../sdks/rust"}
log = "0.4"
simple_logger = "1"
simple_logger = "1.16"
clap = "2"
protobuf = "2.19"
rust-crypto = "0.2.36"
Expand Down
5 changes: 4 additions & 1 deletion tp/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,10 @@ fn main() {
);

let matches = app.get_matches();
let logger = simple_logger::SimpleLogger::new();
let logger = simple_logger::SimpleLogger::new()
// Switch to UTC timestamps, as local timestamps are not stable, by default. They are only
// available if the compiler flag "unsound_local_offset" has been set.
.with_utc_timestamps();
let logger = match matches.occurrences_of("verbose") {
0 => logger.with_level(LevelFilter::Warn),
1 => logger.with_level(LevelFilter::Info),
Expand Down

0 comments on commit f9c1d24

Please sign in to comment.