Make Logging configurable

This commit is contained in:
Snowiiii committed 2024-10-11 16:41:52 +02:00
1 parent 9ac4bdbd50
commit bcbde20623
8 files changed
+141 -15

No files matched your search

+26
View File
@@ -13,6 +13,31 @@ pub struct RCONConfig {
/// The maximum number of concurrent RCON connections allowed.
/// If 0 there is no limit
pub max_connections: u32,
/// RCON Logging
pub logging: RCONLogging,
}
#[derive(Deserialize, Serialize, Clone, Debug)]
pub struct RCONLogging {
/// Whether successful RCON logins should be logged.
pub log_logged_successfully: bool,
/// Whether failed RCON login attempts with incorrect passwords should be logged.
pub log_wrong_password: bool,
/// Whether all RCON commands, regardless of success or failure, should be logged.
pub log_commands: bool,
/// Whether RCON quit commands should be logged.
pub log_quit: bool,
}
impl Default for RCONLogging {
fn default() -> Self {
Self {
log_logged_successfully: true,
log_wrong_password: true,
log_commands: true,
log_quit: true,
}
}
}
impl Default for RCONConfig {
@@ -22,6 +47,7 @@ impl Default for RCONConfig {
address: SocketAddr::new(Ipv4Addr::new(0, 0, 0, 0).into(), 25575),
password: "".to_string(),
max_connections: 0,
logging: Default::default(),
}
}
}