From 62aa8983044005b550ac66d111dacbcefdf2d7a9 Mon Sep 17 00:00:00 2001 From: simonsan <14062932+simonsan@users.noreply.github.com> Date: Mon, 28 Oct 2024 19:17:12 +0100 Subject: [PATCH] add log feature as default so log and tracing can be used Signed-off-by: simonsan <14062932+simonsan@users.noreply.github.com> --- Cargo.lock | 5 +++-- crates/backend/Cargo.toml | 5 ++++- crates/core/Cargo.toml | 5 ++++- 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index eff9ffba..b3ac5120 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3281,7 +3281,6 @@ dependencies = [ "hex", "humantime", "itertools", - "log", "opendal", "rand", "rayon", @@ -3295,6 +3294,7 @@ dependencies = [ "thiserror", "tokio", "toml", + "tracing", "typed-path", "url", "walkdir", @@ -3341,7 +3341,6 @@ dependencies = [ "insta", "integer-sqrt", "itertools", - "log", "mockall", "nix", "pariter", @@ -3372,6 +3371,7 @@ dependencies = [ "tempfile", "thiserror", "toml", + "tracing", "walkdir", "xattr", "zstd", @@ -4201,6 +4201,7 @@ version = "0.1.40" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c3523ab5a71916ccf420eebdf5521fcef02141234bbc0b8a49f2fdc4544364ef" dependencies = [ + "log", "pin-project-lite", "tracing-attributes", "tracing-core", diff --git a/crates/backend/Cargo.toml b/crates/backend/Cargo.toml index 28d21098..1ff64960 100644 --- a/crates/backend/Cargo.toml +++ b/crates/backend/Cargo.toml @@ -31,7 +31,7 @@ edition = "2021" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [features] -default = ["opendal", "rest", "rclone"] +default = ["opendal", "rest", "rclone", "log"] cli = ["merge", "clap"] merge = ["dep:conflate"] clap = ["dep:clap"] @@ -44,6 +44,9 @@ opendal = [ ] rest = ["dep:reqwest", "dep:backoff"] rclone = ["rest", "dep:rand", "dep:semver"] +# When the “log” feature is enabled, if no tracing Subscriber is active, invoking an event +# macro or creating a span with fields will emit a log record. +log = ["tracing/log"] [dependencies] # core diff --git a/crates/core/Cargo.toml b/crates/core/Cargo.toml index 50ae87e9..6b7dd077 100644 --- a/crates/core/Cargo.toml +++ b/crates/core/Cargo.toml @@ -29,11 +29,14 @@ harness = true edition = "2021" [features] -default = [] +default = ["log"] cli = ["merge", "clap"] merge = ["dep:conflate"] clap = ["dep:clap"] webdav = ["dep:dav-server", "dep:futures"] +# When the “log” feature is enabled, if no tracing Subscriber is active, invoking an event +# macro or creating a span with fields will emit a log record. +log = ["tracing/log"] [package.metadata.docs.rs] all-features = true