Skip to content

Commit

Permalink
~
Browse files Browse the repository at this point in the history
  • Loading branch information
oluceps committed Nov 4, 2024
1 parent 0b2fc13 commit 04fff8d
Showing 1 changed file with 4 additions and 11 deletions.
15 changes: 4 additions & 11 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit 04fff8d

Please sign in to comment.