From d93ac94e0e213da0ddaa4411dc0e0620ba1a1710 Mon Sep 17 00:00:00 2001 From: Robin Candau Date: Sun, 9 Aug 2026 01:09:09 +0200 Subject: [PATCH] chore: Only initialize logger if needed Move logger initialization to a later stage so that it is only started if needed (e.g. no need to start the logger to handle the --help and --version arguments) --- src/main.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main.rs b/src/main.rs index a60de38..2f835b7 100644 --- a/src/main.rs +++ b/src/main.rs @@ -23,9 +23,6 @@ struct Args { } fn main() { - // Initialize logger - env_logger::init(); - // Parse arguments let args = Args::parse(); @@ -41,6 +38,9 @@ fn main() { return; } + // Initialize logger + env_logger::init(); + // Create (if needed) and acquire lockfile // Exit if there's already an instance running // or if there was an issue creating or acquiring the lockfile (e.g. permission issue)