()
| 46 | } |
| 47 | |
| 48 | fn setup_logging() -> Result<WorkerGuard> { |
| 49 | let env_filter = EnvFilter::try_from_default_env().unwrap_or_default(); |
| 50 | let (non_blocking, _file_guard) = NonBlocking::new(RollingFileAppender::new(Rotation::NEVER, ".", "chat.log")); |
| 51 | let file_layer = tracing_subscriber::fmt::layer().with_writer(non_blocking); |
| 52 | // .with_ansi(false); |
| 53 | |
| 54 | Registry::default().with(env_filter).with(file_layer).init(); |
| 55 | |
| 56 | Ok(_file_guard) |
| 57 | } |
| 58 | } |
| 59 | |
| 60 | #[derive(Debug, Clone, Subcommand)] |