device-daemon-core 0.0.2

Reusable async daemon and MQTT infrastructure for device clients
Documentation
1
2
3
4
5
6
7
8
9
10
use anyhow::{Context, Result};
use flexi_logger::{Logger, LoggerHandle};
use log::LevelFilter;

pub fn init_flexi_logger(loglevel: LevelFilter) -> Result<LoggerHandle> {
    Logger::try_with_env_or_str(loglevel.as_str())
        .context("Cannot initialize logging")?
        .start()
        .context("Cannot start logging")
}