mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-30 19:51:02 +00:00
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.
This commit is contained in:
committed by
Bastian Köcher
parent
214febc46a
commit
821b2e7184
@@ -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());
|
||||
|
||||
Reference in New Issue
Block a user