From 04fff8db45934cdbf155b38615d55e9bb9ed39fb Mon Sep 17 00:00:00 2001 From: oluceps Date: Mon, 4 Nov 2024 17:19:52 +0800 Subject: [PATCH] ~ --- src/main.rs | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/src/main.rs b/src/main.rs index 1684b3d..7db9081 100644 --- a/src/main.rs +++ b/src/main.rs @@ -2,25 +2,18 @@ use cmd::Args; use eyre::Result; use spdlog::formatter::{pattern, PatternFormatter}; -use std::env; mod cmd; mod helper; mod interop; mod profile; -// > systemd v232 -const SD_INVOCATION_ID_ENV: &str = "INVOCATION_ID"; - fn main() -> Result<()> { let _ = spdlog::init_env_level(); - let as_sd_unit = env::var(SD_INVOCATION_ID_ENV).is_ok(); - if as_sd_unit { - for sink in spdlog::default_logger().sinks() { - sink.set_formatter(Box::new(PatternFormatter::new(pattern!( - "{^{level}} - {payload}{eol}" // remove datetime - )))) - } + for sink in spdlog::default_logger().sinks() { + sink.set_formatter(Box::new(PatternFormatter::new(pattern!( + "{^{level}} - {payload}{eol}" // remove datetime + )))) } let args: Args = argh::from_env(); args.ayaya()