project restructure with Rust workspaces
This commit is contained in:
parent
3ffbe876f3
commit
09f72622bc
428 changed files with 19372 additions and 6061 deletions
25
crates/jarvis-app/src/log.rs
Normal file
25
crates/jarvis-app/src/log.rs
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
use simple_log::LogConfigBuilder;
|
||||
|
||||
use crate::config;
|
||||
use crate::APP_LOG_DIR;
|
||||
|
||||
pub fn init_logging() -> Result<(), String> {
|
||||
// configure logging
|
||||
let config = LogConfigBuilder::builder()
|
||||
.path(format!(
|
||||
"{}/{}",
|
||||
APP_LOG_DIR.get().unwrap().display(),
|
||||
config::LOG_FILE_NAME
|
||||
))
|
||||
.size(1 * 100)
|
||||
.roll_count(10)
|
||||
.time_format("%Y-%m-%d %H:%M:%S.%f")
|
||||
.level("debug")?
|
||||
.output_file()
|
||||
.output_console()
|
||||
.build();
|
||||
|
||||
simple_log::new(config)?;
|
||||
|
||||
Ok(())
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue