Fix cargo-deny. (#522)

* Fix cargo-deny.

* Update time crate.

* Fix time issues.
This commit is contained in:
Tomasz Drwięga authored and Bastian Köcher committed 2024-04-10 10:28:37 +02:00
1 parent e91cab68d4
commit 667f26bfdb
1 file changed
+3 -1
+3 -1
View File
@@ -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 {