Add serde defaults for logging
This commit is contained in:
parent
68ab173ee8
commit
7db8c0ed97
@ -8,6 +8,7 @@ pub struct CommandsConfig {
|
|||||||
#[serde_inline_default(true)]
|
#[serde_inline_default(true)]
|
||||||
pub use_console: bool,
|
pub use_console: bool,
|
||||||
/// Should be commands from players be logged in console?
|
/// Should be commands from players be logged in console?
|
||||||
|
#[serde_inline_default(true)]
|
||||||
pub log_console: bool, // TODO: commands...
|
pub log_console: bool, // TODO: commands...
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -43,20 +43,14 @@ pub static BASIC_CONFIG: LazyLock<BasicConfiguration> = LazyLock::new(BasicConfi
|
|||||||
/// This also allows you get some Performance or Resource boosts.
|
/// This also allows you get some Performance or Resource boosts.
|
||||||
/// Important: The Configuration should match Vanilla by default
|
/// Important: The Configuration should match Vanilla by default
|
||||||
#[derive(Deserialize, Serialize, Default)]
|
#[derive(Deserialize, Serialize, Default)]
|
||||||
|
#[serde(default)]
|
||||||
pub struct AdvancedConfiguration {
|
pub struct AdvancedConfiguration {
|
||||||
#[serde(default)]
|
|
||||||
pub proxy: ProxyConfig,
|
pub proxy: ProxyConfig,
|
||||||
#[serde(default)]
|
|
||||||
pub authentication: AuthenticationConfig,
|
pub authentication: AuthenticationConfig,
|
||||||
#[serde(default)]
|
|
||||||
pub packet_compression: CompressionConfig,
|
pub packet_compression: CompressionConfig,
|
||||||
#[serde(default)]
|
|
||||||
pub resource_pack: ResourcePackConfig,
|
pub resource_pack: ResourcePackConfig,
|
||||||
#[serde(default)]
|
|
||||||
pub commands: CommandsConfig,
|
pub commands: CommandsConfig,
|
||||||
#[serde(default)]
|
|
||||||
pub rcon: RCONConfig,
|
pub rcon: RCONConfig,
|
||||||
#[serde(default)]
|
|
||||||
pub pvp: PVPConfig,
|
pub pvp: PVPConfig,
|
||||||
pub logging: LoggingConfig,
|
pub logging: LoggingConfig,
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,12 +1,20 @@
|
|||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
|
use serde_inline_default::serde_inline_default;
|
||||||
|
|
||||||
|
#[serde_inline_default]
|
||||||
#[derive(Deserialize, Serialize)]
|
#[derive(Deserialize, Serialize)]
|
||||||
pub struct LoggingConfig {
|
pub struct LoggingConfig {
|
||||||
|
#[serde_inline_default(true)]
|
||||||
pub enabled: bool,
|
pub enabled: bool,
|
||||||
|
#[serde_inline_default(LevelFilter::Info)]
|
||||||
pub level: LevelFilter,
|
pub level: LevelFilter,
|
||||||
|
#[serde_inline_default(false)]
|
||||||
pub env: bool,
|
pub env: bool,
|
||||||
|
#[serde_inline_default(true)]
|
||||||
pub threads: bool,
|
pub threads: bool,
|
||||||
|
#[serde_inline_default(true)]
|
||||||
pub color: bool,
|
pub color: bool,
|
||||||
|
#[serde_inline_default(true)]
|
||||||
pub timestamp: bool,
|
pub timestamp: bool,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -23,15 +23,20 @@ pub struct RCONConfig {
|
|||||||
pub logging: RCONLogging,
|
pub logging: RCONLogging,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[serde_inline_default]
|
||||||
#[derive(Deserialize, Serialize, Clone, Debug)]
|
#[derive(Deserialize, Serialize, Clone, Debug)]
|
||||||
pub struct RCONLogging {
|
pub struct RCONLogging {
|
||||||
/// Whether successful RCON logins should be logged.
|
/// Whether successful RCON logins should be logged.
|
||||||
|
#[serde_inline_default(true)]
|
||||||
pub log_logged_successfully: bool,
|
pub log_logged_successfully: bool,
|
||||||
/// Whether failed RCON login attempts with incorrect passwords should be logged.
|
/// Whether failed RCON login attempts with incorrect passwords should be logged.
|
||||||
|
#[serde_inline_default(true)]
|
||||||
pub log_wrong_password: bool,
|
pub log_wrong_password: bool,
|
||||||
/// Whether all RCON commands, regardless of success or failure, should be logged.
|
/// Whether all RCON commands, regardless of success or failure, should be logged.
|
||||||
|
#[serde_inline_default(true)]
|
||||||
pub log_commands: bool,
|
pub log_commands: bool,
|
||||||
/// Whether RCON quit commands should be logged.
|
/// Whether RCON quit commands should be logged.
|
||||||
|
#[serde_inline_default(true)]
|
||||||
pub log_quit: bool,
|
pub log_quit: bool,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user