patch: Initialize w/ unified command

This commit is contained in:
Erik Kundt
2023-12-23 11:41:46 +01:00
parent bfc6909cfa
commit 74940ca7bf
15 changed files with 271 additions and 569 deletions
+1
View File
@@ -10,6 +10,7 @@ use tuirealm::{Application, EventListenerCfg, NoUserEvent};
pub mod cob;
pub mod context;
pub mod log;
pub mod ui;
use context::Context;
+15
View File
@@ -0,0 +1,15 @@
use log::LevelFilter;
use radicle::profile::Profile;
pub fn enable(cmd: &str, op: &str, profile: &Profile) -> Result<(), anyhow::Error> {
let logfile = format!(
"{}/rad-tui-{}-{}.log",
profile.home().path().to_string_lossy(),
cmd,
op,
);
simple_logging::log_to_file(logfile, LevelFilter::Info)?;
Ok(())
}