pub struct LoggingConfig {
pub default_env_filter: String,
pub pretty_stdout: bool,
pub enable_hft_layer: bool,
pub hft_log_dir: PathBuf,
pub hft_log_prefix: String,
pub hft_target: String,
pub hft_level: Level,
}Expand description
Configuration for the multi-layer logging system.
Fields§
§default_env_filter: StringDefault RUST_LOG filter string if RUST_LOG env var is not set.
Example: "info,janus=debug,janus::hft=off"
pretty_stdout: boolWhether to use the .pretty() formatter for stdout (multi-line,
coloured). Set to false for JSON output in production / CI.
enable_hft_layer: boolWhether to enable the HFT file logging layer.
hft_log_dir: PathBufDirectory for HFT rolling log files.
Default: "./logs/hft"
hft_log_prefix: StringFilename prefix for HFT rolling logs.
Default: "hft.log"
hft_target: StringThe tracing target that the HFT layer listens to.
Default: "janus::hft"
Events must be emitted with this target to appear in the HFT log:
tracing::trace!(target: "janus::hft", symbol = "BTCUSD", price = 42000.0);hft_level: LevelMaximum tracing level recorded by the HFT layer.
Default: Level::TRACE (capture everything targeted at janus::hft).
Implementations§
Source§impl LoggingConfig
impl LoggingConfig
Sourcepub fn with_env_filter(self, filter: impl Into<String>) -> Self
pub fn with_env_filter(self, filter: impl Into<String>) -> Self
Builder: set the default env filter.
Sourcepub fn with_hft_dir(self, dir: impl Into<PathBuf>) -> Self
pub fn with_hft_dir(self, dir: impl Into<PathBuf>) -> Self
Builder: set the HFT log directory.
Sourcepub fn without_hft(self) -> Self
pub fn without_hft(self) -> Self
Builder: disable HFT file logging.
Sourcepub fn with_json_stdout(self) -> Self
pub fn with_json_stdout(self) -> Self
Builder: use JSON output instead of pretty printing.
Trait Implementations§
Source§impl Clone for LoggingConfig
impl Clone for LoggingConfig
Source§fn clone(&self) -> LoggingConfig
fn clone(&self) -> LoggingConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more