diff --git a/config.yaml b/config.yaml index 550251d..8f4e5ae 100644 --- a/config.yaml +++ b/config.yaml @@ -20,6 +20,9 @@ force-https: true storage-url: http://devweb.local/comunic/current/user_data/ storage-path: /home/pierre/Documents/projets_web/comunic/current/user_data/ +# Print more information to the console +verbose-mode: true + # Database configuration database: host: localhost diff --git a/src/controllers/user_ws_controller.rs b/src/controllers/user_ws_controller.rs index c77074c..b59f270 100644 --- a/src/controllers/user_ws_controller.rs +++ b/src/controllers/user_ws_controller.rs @@ -355,7 +355,7 @@ impl StreamHandler> for WsSession { Ok(msg) => msg, }; - if conf().database.log_all_queries + if conf().verbose_mode { println!("USER WEBSOCKET MESSAGE: {:?}", msg); } @@ -376,7 +376,7 @@ impl StreamHandler> for WsSession { let response = serde_json::to_string(&msg) .unwrap_or("Failed to serialize".to_string()); - if conf().database.log_all_queries { + if conf().verbose_mode { println!("USER WEBSOCKET RESPONSE {}", response); } diff --git a/src/data/config.rs b/src/data/config.rs index 2beb71a..ceead81 100644 --- a/src/data/config.rs +++ b/src/data/config.rs @@ -23,6 +23,7 @@ pub struct Config { pub database: DatabaseConfig, pub proxy: Option, pub force_https: bool, + pub verbose_mode: bool, } /// Globally available configuration @@ -80,6 +81,8 @@ impl Config { }, force_https: Config::yaml_bool(parsed, "force-https"), + + verbose_mode: Config::yaml_bool(parsed, "verbose-mode"), }; // Save new configuration in memory