Add log feature to tracing (#300)

This commit is contained in:
Félix Saparelli 2022-06-07 12:15:17 +00:00
parent 557efab1c4
commit 62e79fbf7a
4 changed files with 11 additions and 3 deletions

5
Cargo.lock generated
View File

@ -2427,9 +2427,9 @@ dependencies = [
[[package]]
name = "tracing-log"
version = "0.1.2"
version = "0.1.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a6923477a48e41c1951f1999ef8bb5a3023eb723ceadafe78ffb65dc366761e3"
checksum = "78ddad33d2d10b1ed7eb9d1f518a5674713876e97e5bb9b7345a7984fbb4f922"
dependencies = [
"lazy_static",
"log",
@ -2633,6 +2633,7 @@ dependencies = [
"notify-rust",
"tokio",
"tracing",
"tracing-log",
"tracing-subscriber",
"watchexec",
]

View File

@ -28,6 +28,7 @@ futures = "0.3.17"
miette = { version = "3.2.0", features = ["fancy"] }
notify-rust = "4.5.2"
tracing = "0.1.26"
tracing-log = "0.1.3"
watchexec = { version = "=2.0.0-pre.14", path = "../lib" }
[dependencies.clap]

View File

@ -2,6 +2,7 @@
use std::env::var;
use tracing_log::LogTracer;
use miette::{IntoDiagnostic, Result};
use tracing::debug;
use watchexec::{event::Event, Watchexec};
@ -16,6 +17,8 @@ static GLOBAL: mimalloc::MiMalloc = mimalloc::MiMalloc;
#[tokio::main]
async fn main() -> Result<()> {
LogTracer::init().into_diagnostic()?;
#[cfg(feature = "dev-console")]
console_subscriber::init();

View File

@ -30,7 +30,6 @@ nom = "7.0.0"
once_cell = "1.8.0"
regex = "1.5.4"
thiserror = "1.0.26"
tracing = "0.1.26"
unicase = "2.6.0"
[dependencies.command-group]
@ -57,6 +56,10 @@ features = [
version = "0.1.7"
features = ["fs"]
[dependencies.tracing]
version = "0.1.26"
features = ["log"]
[target.'cfg(unix)'.dependencies]
libc = "0.2.104"