Skip to content
Snippets Groups Projects
Commit 821b2e71 authored by Svyatoslav Nikolsky's avatar Svyatoslav Nikolsky Committed by Bastian Köcher
Browse files

Fix issues from cargo deny (#1311)

* update libp2p-core (RUSTSEC-2022-0009)

* update thread_local (RUSTSEC-2022-0006)

* time 0.2 -> time 0.3

* ignore RUSTSEC-2021-0130

* proper migration to time 0.3

* fix clippy?

* Revert "fix clippy?"

This reverts commit 53bc289631769071848e43976871304782486fed.
parent 214febc4
No related merge requests found
......@@ -19,7 +19,7 @@ log = "0.4.11"
num-traits = "0.2"
serde_json = "1.0"
sysinfo = "0.15"
time = "0.2"
time = { version = "0.3", features = ["formatting", "local-offset", "std"] }
thiserror = "1.0.26"
# Bridge dependencies
......
......@@ -29,15 +29,21 @@ pub fn initialize_relay() {
/// Initialize Relay logger instance.
pub fn initialize_logger(with_timestamp: bool) {
let format = time::format_description::parse(
"[year]-[month]-[day] \
[hour repr:24]:[minute]:[second] [offset_hour sign:mandatory]",
)
.expect("static format string is valid");
let mut builder = env_logger::Builder::new();
builder.filter_level(log::LevelFilter::Warn);
builder.filter_module("bridge", log::LevelFilter::Info);
builder.parse_default_env();
if with_timestamp {
builder.format(move |buf, record| {
let timestamp = time::OffsetDateTime::try_now_local()
.unwrap_or_else(|_| time::OffsetDateTime::now_utc())
.format("%Y-%m-%d %H:%M:%S %z");
let timestamp = time::OffsetDateTime::now_local()
.unwrap_or_else(|_| time::OffsetDateTime::now_utc());
let timestamp = timestamp.format(&format).unwrap_or_else(|_| timestamp.to_string());
let log_level = color_level(record.level());
let log_target = color_target(record.target());
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment