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 6fa5c05 commit 9579c0a
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,18 @@ mod cmd;
mod helper;
mod interop;
mod profile;
use std::os::unix::process::parent_id;

fn main() -> Result<()> {
let _ = spdlog::init_env_level();
for sink in spdlog::default_logger().sinks() {
sink.set_formatter(Box::new(PatternFormatter::new(pattern!(
"{^{level}} - {payload}{eol}" // remove datetime
))))
let as_sd_unit = parent_id() == 1;
if as_sd_unit {
for sink in spdlog::default_logger().sinks() {
sink.set_formatter(Box::new(PatternFormatter::new(pattern!(
"{^{level}} - {payload}{eol}" // remove datetime
))))
}
spdlog::debug!("Detected running as systemd unit");
}
let args: Args = argh::from_env();
args.ayaya()
Expand Down

0 comments on commit 9579c0a

Please sign in to comment.