add: logger

This commit is contained in:
2026-11-24 21:48:45 +01:00
parent 01e38bb791
commit ba66bdb68a
12 changed files with 342 additions and 11 deletions

View File

@@ -2,6 +2,7 @@ use clap::Parser as _;
mod args;
mod config;
mod log;
mod server;
mod consts {
@@ -10,6 +11,7 @@ mod consts {
fn main() -> anyhow::Result<()> {
let args = args::Args::parse();
log::state::set_log_level(args.loglevel);
match args.command {
args::Command::Serve {
@@ -20,7 +22,8 @@ fn main() -> anyhow::Result<()> {
let config = config::Config::open(config_path)?;
println!("{config:#?}");
#[cfg(debug_assertions)]
crate::log::macros::trace!("{config:#?}");
let rt = tokio::runtime::Builder::new_multi_thread()
.enable_all()