Add log/env_logger crate

Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
This commit is contained in:
Maxime “pep” Buquet 2022-07-24 18:44:21 +02:00
parent c9e926b3ec
commit 80b8efce6f
Signed by: pep
GPG key ID: DEDA74AEECA9D0F2
2 changed files with 6 additions and 0 deletions

View file

@ -13,3 +13,5 @@ dbus-tokio = "0.7.5"
tokio = { version = "1.19.2", features = [ "time", "macros", "rt-multi-thread" ] } tokio = { version = "1.19.2", features = [ "time", "macros", "rt-multi-thread" ] }
futures = "0.3" futures = "0.3"
futures-util = "0.3" futures-util = "0.3"
log = "0.4"
env_logger = "0.8"

View file

@ -23,6 +23,8 @@ use std::fmt;
use std::sync::Arc; use std::sync::Arc;
use futures_util::stream::StreamExt; use futures_util::stream::StreamExt;
use env_logger;
use tokio::{ use tokio::{
task::JoinHandle, task::JoinHandle,
time::Duration, time::Duration,
@ -193,6 +195,8 @@ async fn print_foo(mm: ModemManager) -> Result<(), Error> {
#[tokio::main] #[tokio::main]
pub async fn main() -> Result<(), Box<dyn std::error::Error>> { pub async fn main() -> Result<(), Box<dyn std::error::Error>> {
env_logger::init();
let dbus = DBus::connect()?; let dbus = DBus::connect()?;
let mut interval = tokio::time::interval(Duration::from_secs(2)); let mut interval = tokio::time::interval(Duration::from_secs(2));