From 26698165ce1717f51eaa5175653e29d48e4ba2ba Mon Sep 17 00:00:00 2001 From: Nick Mello Date: Sat, 7 Feb 2026 20:54:27 -0600 Subject: [PATCH] Add name argument Gives more options to the user to customize logs Signed-off-by: Nicholas Mello --- Cargo.lock | 2 +- src/main.rs | 10 +++++++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index bc0862b..f5add67 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -64,7 +64,7 @@ dependencies = [ [[package]] name = "arcade-logger" version = "0.1.0" -source = "git+ssh://gitea@ssh.git.home.arpa/arcade/arcade-logger.git?branch=main#498f2772d638bed649403cce00b7910cbd69e800" +source = "git+ssh://gitea@ssh.git.home.arpa/arcade/arcade-logger.git?branch=main#79596732e991befe3c7d18fb3b09d13e66a9877b" dependencies = [ "chrono", "log 0.4.29", diff --git a/src/main.rs b/src/main.rs index f768f14..291376d 100644 --- a/src/main.rs +++ b/src/main.rs @@ -25,6 +25,9 @@ impl From for Level { #[derive(Parser)] struct Args { + #[arg(short, long)] + name: Option, + #[arg(short, long, default_value = "info")] log_level: LogLevel, @@ -34,8 +37,13 @@ struct Args { fn main() { let args = Args::parse(); + let name = match args.name { + Some(name) => name, + None => "command-line".into(), + }; + // Initialize the logging system - init_logging("command-line"); + init_logging(name.as_str()); log!(args.log_level.into(), "{}", args.print_string); }