mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-31 00:31:02 +00:00
Make sure that relayers have dates in logs. (#927)
This commit is contained in:
committed by
Bastian Köcher
parent
479e51c67b
commit
7c2b54c5e7
@@ -89,8 +89,23 @@ pub enum Command {
|
|||||||
}
|
}
|
||||||
|
|
||||||
impl Command {
|
impl Command {
|
||||||
|
// Initialize logger depending on the command.
|
||||||
|
fn init_logger(&self) {
|
||||||
|
use relay_utils::initialize::{initialize_logger, initialize_relay};
|
||||||
|
|
||||||
|
match self {
|
||||||
|
Self::RelayHeaders(_) | Self::RelayMessages(_) | Self::RelayHeadersAndMessages(_) | Self::InitBridge(_) => {
|
||||||
|
initialize_relay();
|
||||||
|
}
|
||||||
|
_ => {
|
||||||
|
initialize_logger(false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// Run the command.
|
/// Run the command.
|
||||||
pub async fn run(self) -> anyhow::Result<()> {
|
pub async fn run(self) -> anyhow::Result<()> {
|
||||||
|
self.init_logger();
|
||||||
match self {
|
match self {
|
||||||
Self::RelayHeaders(arg) => arg.run().await?,
|
Self::RelayHeaders(arg) => arg.run().await?,
|
||||||
Self::RelayMessages(arg) => arg.run().await?,
|
Self::RelayMessages(arg) => arg.run().await?,
|
||||||
|
|||||||
@@ -18,8 +18,6 @@
|
|||||||
|
|
||||||
#![warn(missing_docs)]
|
#![warn(missing_docs)]
|
||||||
|
|
||||||
use relay_utils::initialize::initialize_logger;
|
|
||||||
|
|
||||||
mod chains;
|
mod chains;
|
||||||
mod cli;
|
mod cli;
|
||||||
mod finality_pipeline;
|
mod finality_pipeline;
|
||||||
@@ -31,7 +29,6 @@ mod messages_target;
|
|||||||
mod on_demand_headers;
|
mod on_demand_headers;
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
initialize_logger(false);
|
|
||||||
let command = cli::parse_args();
|
let command = cli::parse_args();
|
||||||
let run = command.run();
|
let run = command.run();
|
||||||
let result = async_std::task::block_on(run);
|
let result = async_std::task::block_on(run);
|
||||||
|
|||||||
Reference in New Issue
Block a user