From 80b8efce6fbc143aa030f3bd70550009d9abc9ca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maxime=20=E2=80=9Cpep=E2=80=9D=20Buquet?= Date: Sun, 24 Jul 2022 18:44:21 +0200 Subject: [PATCH] Add log/env_logger crate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Maxime “pep” Buquet --- Cargo.toml | 2 ++ src/main.rs | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/Cargo.toml b/Cargo.toml index ab90fa4..c7a725a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -13,3 +13,5 @@ dbus-tokio = "0.7.5" tokio = { version = "1.19.2", features = [ "time", "macros", "rt-multi-thread" ] } futures = "0.3" futures-util = "0.3" +log = "0.4" +env_logger = "0.8" diff --git a/src/main.rs b/src/main.rs index 338ae8e..dda0f77 100644 --- a/src/main.rs +++ b/src/main.rs @@ -23,6 +23,8 @@ use std::fmt; use std::sync::Arc; use futures_util::stream::StreamExt; +use env_logger; + use tokio::{ task::JoinHandle, time::Duration, @@ -193,6 +195,8 @@ async fn print_foo(mm: ModemManager) -> Result<(), Error> { #[tokio::main] pub async fn main() -> Result<(), Box> { + env_logger::init(); + let dbus = DBus::connect()?; let mut interval = tokio::time::interval(Duration::from_secs(2));