common: dedup and move banner to common/logging (#2846)

This commit is contained in:
Jon Häggblad
2023-01-16 08:32:35 +01:00
committed by GitHub
parent cc7161c113
commit dc71f6e94d
6 changed files with 26 additions and 77 deletions
+2 -19
View File
@@ -6,7 +6,7 @@ extern crate rocket;
use ::config::defaults::setup_env;
use build_information::BinaryBuildInformation;
use clap::{crate_version, Parser, ValueEnum};
use clap::{crate_name, crate_version, Parser, ValueEnum};
use lazy_static::lazy_static;
use logging::setup_logging;
@@ -64,7 +64,7 @@ impl Cli {
async fn main() {
setup_logging();
if atty::is(atty::Stream::Stdout) {
println!("{}", banner());
println!("{}", logging::banner(crate_name!(), crate_version!()));
}
let args = Cli::parse();
@@ -72,23 +72,6 @@ async fn main() {
commands::execute(args).await;
}
fn banner() -> String {
format!(
r#"
_ __ _ _ _ __ ___
| '_ \| | | | '_ \ _ \
| | | | |_| | | | | | |
|_| |_|\__, |_| |_| |_|
|___/
(mixnode - version {:})
"#,
crate_version!()
)
}
#[cfg(test)]
mod tests {
use super::*;