Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
137 changes: 19 additions & 118 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 2 additions & 6 deletions deny.toml
Original file line number Diff line number Diff line change
Expand Up @@ -48,21 +48,17 @@ notice = "warn"
# A list of advisory IDs to ignore. Note that ignored advisories will still
# output a note when they are encountered.
ignore = [
# yaml-rust < clap. Not feasible to upgrade and also not possible to trigger in practice.
"RUSTSEC-2018-0006",
"RUSTSEC-2020-0070",
# Comes from honggfuzz via storage-proof-fuzzer: 'memmap'
"RUSTSEC-2020-0077",
# Comes from time: 'stweb' (will be fixed in upcoming time 0.3)
"RUSTSEC-2020-0056",
# net2 (origin: Substrate RPC crates)
"RUSTSEC-2020-0016",
# Wasmtime (origin: Substrate executor crates)
"RUSTSEC-2021-0110",
# time (origin: Substrate RPC + benchmarking crates)
"RUSTSEC-2020-0071",
# chrono (origin: Substrate benchmarking + cli + ...)
"RUSTSEC-2020-0159",
# lru 0.6.6 (origin: libp2p)
"RUSTSEC-2021-0130",
]
# Threshold for security vulnerabilities, any vulnerability with a CVSS score
# lower than the range specified will be ignored. Note that ignored advisories
Expand Down
2 changes: 1 addition & 1 deletion relays/utils/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
12 changes: 9 additions & 3 deletions relays/utils/src/initialize.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand Down