mirror of
https://github.com/OMGeeky/confique.git
synced 2026-01-05 19:20:26 +01:00
This was mostly what I implemented as utility library for another project. But I figured I can also extract it as it's useful on its own.
23 lines
529 B
Rust
23 lines
529 B
Rust
|
|
mod config {
|
|
use std::path::PathBuf;
|
|
|
|
confique::config! {
|
|
log: {
|
|
/// Determines how many messages are logged. Log messages below
|
|
/// this level are not emitted. Possible values: "trace", "debug",
|
|
/// "info", "warn", "error" and "off".
|
|
level: log::LevelFilter = "debug",
|
|
|
|
/// If this is set, log messages are also written to this file.
|
|
#[example = "/var/log/tobira.log"]
|
|
file: Option<PathBuf>,
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
fn main() {
|
|
|
|
}
|