Skip to content

Commit

Permalink
Fix cargo-deny. (paritytech#522)
Browse files Browse the repository at this point in the history
* Fix cargo-deny.

* Update time crate.

* Fix time issues.
  • Loading branch information
tomusdrw authored and serban300 committed Apr 9, 2024
1 parent df909b7 commit 525d829
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion bridges/relays/utils/src/initialize.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,9 @@ pub fn initialize_relay() {
builder.parse_filters(&filters);
builder.format(move |buf, record| {
writeln!(buf, "{}", {
let timestamp = time::OffsetDateTime::now_local().format("%Y-%m-%d %H:%M:%S %z");
let timestamp = time::OffsetDateTime::try_now_local()
.unwrap_or_else(|_| time::OffsetDateTime::now_utc())
.format("%Y-%m-%d %H:%M:%S %z");
if cfg!(windows) {
format!("{} {} {} {}", timestamp, record.level(), record.target(), record.args())
} else {
Expand Down

0 comments on commit 525d829

Please sign in to comment.