pub struct BabyriteConfig {
pub json_logging: bool,
pub log: LogConfig,
pub features: FeatureConfig,
pub github: GitHubConfig,
}Expand description
Babyrite configuration.
Loaded from config.toml. All fields have default values, so existing
configuration files without the new sections will continue to work.
Fields§
§json_logging: boolIf enabled, logs are output in JSON format.
Deprecated: use [log] format = "json" instead. Kept for backward
compatibility — it is only consulted when log.format is unset
(see BabyriteConfig::resolved_log_format).
log: LogConfigLogging configuration (level and format).
features: FeatureConfigFeature flags for enabling/disabling specific functionality.
github: GitHubConfigGitHub-related configuration.
Implementations§
Source§impl BabyriteConfig
impl BabyriteConfig
Sourcepub fn init() -> Result<(), BabyriteConfigError>
pub fn init() -> Result<(), BabyriteConfigError>
Initializes the global configuration.
Loads configuration from a file if CONFIG_FILE_PATH is set,
otherwise uses default values.
Sourcepub fn get() -> &'static BabyriteConfig
pub fn get() -> &'static BabyriteConfig
Returns a reference to the global configuration.
§Panics
Panics if BabyriteConfig::init has not been called.
Sourcepub fn resolved_log_format(&self) -> LogFormat
pub fn resolved_log_format(&self) -> LogFormat
Resolves the effective log output format.
Uses [log] format when set; otherwise falls back to the deprecated
json_logging flag (true → JSON, false → compact) so existing
configuration files keep their previous behavior.