diff --git a/.gitignore b/.gitignore index 0bd1d76..4d356db 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ /target settings.toml .direnv/* +logs/* \ No newline at end of file diff --git a/settings.toml b/settings.toml index 38593c3..6a4be7c 100644 --- a/settings.toml +++ b/settings.toml @@ -1,4 +1,4 @@ -camera_ip = "10.0.0.33" +camera_ip = "localhost" camera_port = 8765 tracker_ip = "localhost" tracker_port = 6543 diff --git a/src/main.rs b/src/main.rs index 4c1e875..cb746fb 100644 --- a/src/main.rs +++ b/src/main.rs @@ -3,8 +3,6 @@ use gtk::{glib, Application}; use std::{env, sync::Arc}; use tokio::{runtime, sync::RwLock}; use tracing::{self, info, Level}; -#[cfg(not(debug_assertions))] -use tracing_appender; use tracing_subscriber; use crate::config::{load_config, AppConfig}; @@ -20,24 +18,15 @@ const APP_ID: &str = "net.nickiel.joystick-controller-client"; fn main() -> glib::ExitCode { // set the environment var to make gtk use window's default action bar env::set_var("gtk_csd", "0"); - - #[cfg(not(debug_assertions))] - { - let file_appender = tracing_appender::rolling::daily(".", "joystick-log"); - let (non_blocking, _gaurd) = tracing_appender::non_blocking(file_appender); - tracing_subscriber::fmt() - .with_writer(non_blocking) - .with_max_level(tracing::Level::DEBUG) - .init(); - } - #[cfg(debug_assertions)] - { - tracing_subscriber::fmt() - // .compact() - .pretty() - .with_max_level(tracing::Level::DEBUG) - .init(); - } + + // #[cfg(not(debug_assertions))] + let file_appender = tracing_appender::rolling::daily(".\\logs", "camera-controller"); + let (non_blocking, _gaurd) = tracing_appender::non_blocking(file_appender); + tracing_subscriber::fmt() + .with_writer(non_blocking) + .with_max_level(tracing::Level::DEBUG) + .with_ansi(false) + .init(); let span = tracing::span!(Level::TRACE, "main"); let _enter = span.enter();