feat: rework logs (#2988)

This commit is contained in:
Bjerg
2023-06-05 19:43:14 +02:00
committed by GitHub
parent 643b3811c2
commit d2c68edf23
24 changed files with 74 additions and 70 deletions

View File

@ -277,19 +277,19 @@ impl RpcServerArgs {
let server_config = self.rpc_server_config();
let launch_rpc = rpc_modules.start_server(server_config).map_ok(|handle| {
if let Some(url) = handle.ipc_endpoint() {
info!(target: "reth::cli", url=%url, "IPC server started");
info!(target: "reth::cli", url=%url, "RPC IPC server started");
}
if let Some(addr) = handle.http_local_addr() {
info!(target: "reth::cli", url=%addr, "HTTP server started");
info!(target: "reth::cli", url=%addr, "RPC HTTP server started");
}
if let Some(addr) = handle.ws_local_addr() {
info!(target: "reth::cli", url=%addr, "WS server started");
info!(target: "reth::cli", url=%addr, "RPC WS server started");
}
handle
});
let launch_auth = auth_module.start_server(auth_config).inspect(|_| {
info!(target: "reth::cli", "Started Auth server");
info!(target: "reth::cli", "RPC auth server started");
});
// launch servers concurrently

View File

@ -108,7 +108,7 @@ pub struct Logs {
journald: bool,
/// The filter to use for logs written to the log file.
#[arg(long = "log.filter", value_name = "FILTER", global = true, default_value = "debug")]
#[arg(long = "log.filter", value_name = "FILTER", global = true, default_value = "error")]
filter: String,
}
@ -166,7 +166,7 @@ impl Verbosity {
_ => Level::TRACE,
};
format!("reth::cli={level}").parse().unwrap()
format!("{level}").parse().unwrap()
}
}
}

View File

@ -95,7 +95,7 @@ impl<'a, DB: Database> DbTool<'a, DB> {
/// Drops the database at the given path.
pub fn drop(&mut self, path: impl AsRef<Path>) -> Result<()> {
let path = path.as_ref();
info!(target: "reth::cli", "Dropping db at {:?}", path);
info!(target: "reth::cli", "Dropping database at {:?}", path);
std::fs::remove_dir_all(path).wrap_err("Dropping the database failed")?;
Ok(())
}