blob: 13a9b7fb00b7a16c769ab52cdc8bf5e4103e6b4f (
plain) (
tree)
|
|
#![feature(lazy_cell)]
use dotenv::var;
use log::LevelFilter;
use std::fs::File;
use lfm_embed::STATE;
fn main() {
env_logger::Builder::new()
.filter_level(LevelFilter::Warn)
.parse_filters(&var("LFME_LOG_LEVEL").unwrap_or_default())
.target(
var("LFME_LOG_FILE").ok()
.map(
|f| env_logger::Target::Pipe(
Box::new(File::options()
.append(true)
.open(f)
.expect("couldn't open LFME_LOG_FILE")))
)
.unwrap_or(env_logger::Target::Stderr)
).init();
std::sync::LazyLock::force(&STATE);
}
|