aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--crates/whirl/src/lib.rs11
1 files changed, 9 insertions, 2 deletions
diff --git a/crates/whirl/src/lib.rs b/crates/whirl/src/lib.rs
index e88c818..9297ccc 100644
--- a/crates/whirl/src/lib.rs
+++ b/crates/whirl/src/lib.rs
@@ -59,8 +59,15 @@ impl Whirl {
flexi_logger::Logger::try_with_str(whirl_common::log::calculate_log_level()).unwrap();
if std::env::var("LOG_FILE").unwrap_or_else(|_| "true".to_string()) == "false"
|| !whirl_config::Config::get().whirlsplash.log.file
- || std::env::args().collect::<Vec<_>>()[1] == "clean"
- // Cheeky as all hell.
+ || ({
+ // Cheeky as all hell.
+ let args = std::env::args().collect::<Vec<_>>();
+ if args.len() == 2 {
+ args[1] == "clean"
+ } else {
+ false
+ }
+ })
{
logger.start()?;
} else {