Skip to content

Commit

Permalink
Update: update log level and add trace logs
Browse files Browse the repository at this point in the history
  • Loading branch information
pchpub committed Dec 9, 2023
1 parent 1c102d1 commit 77d0355
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
/target
/config.toml
7 changes: 5 additions & 2 deletions src/main.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use ddns_rust::mods::{config::spawn::init_config, handle::spawn_tasks, statics::CONFIG};
use log::error;
use log::{error, trace};
use std::env;

#[tokio::main]
Expand Down Expand Up @@ -39,7 +39,8 @@ async fn main() {
})
.filter(
None,
<LevelFilter as std::str::FromStr>::from_str(&log_level)
log_level
.parse::<LevelFilter>()
.unwrap_or(LevelFilter::Info),
)
.parse_default_env()
Expand All @@ -52,6 +53,8 @@ async fn main() {
// initialization plugins end

// initialization tasks
trace!("initialization tasks");
println!("test");
if let Err(value) = spawn_tasks().await {
error!("initialization tasks failed: {}", value);
panic!("Error: failed to spawn tasks in main() reason: {}", value);
Expand Down
2 changes: 1 addition & 1 deletion src/mods/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ impl ToString for LogLevel {
impl Config {
pub fn new() -> Config {
Config {
log_level: LogLevel::Info,
log_level: LogLevel::Trace,
// plugins: Vec::new(),
sites_config: Vec::new(),
}
Expand Down

0 comments on commit 77d0355

Please sign in to comment.