Skip to content

Commit 2c13830

Browse files
committed
tracing to logforth in test
Signed-off-by: tison <[email protected]>
1 parent a02221c commit 2c13830

File tree

12 files changed

+145
-192
lines changed

12 files changed

+145
-192
lines changed

bin/oay/Cargo.lock

Lines changed: 70 additions & 133 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

bin/oay/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,8 @@ chrono = "0.4.31"
4646
dav-server = { version = "0.7", optional = true }
4747
dav-server-opendalfs = { version = "0.3.0", path = "../../integrations/dav-server", optional = true }
4848
futures-util = { version = "0.3.29", optional = true }
49+
log = { version = "0.4.22" }
50+
logforth = { version = "0.21.0", default-features = false }
4951
opendal = { version = "0.51.0", path = "../../core", features = [
5052
"services-fs",
5153
] }
@@ -59,5 +61,3 @@ tokio = { version = "1.39", features = [
5961
] }
6062
toml = "0.8.12"
6163
tower = { version = "0.4", features = ["util"] }
62-
tracing = "0.1"
63-
tracing-subscriber = { version = "0.3", features = ["env-filter"] }

bin/oay/src/bin/oay.rs

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,6 @@ use oay::Config;
2626
use opendal::services::Fs;
2727
use opendal::Operator;
2828
use opendal::Scheme;
29-
use tracing_subscriber::fmt;
30-
use tracing_subscriber::prelude::*;
31-
use tracing_subscriber::EnvFilter;
3229

3330
#[tokio::main]
3431
async fn main() -> Result<()> {
@@ -37,10 +34,7 @@ async fn main() -> Result<()> {
3734
}
3835

3936
async fn s3() -> Result<()> {
40-
tracing_subscriber::registry()
41-
.with(fmt::layer().pretty())
42-
.with(EnvFilter::from_default_env())
43-
.init();
37+
logforth::stderr().apply();
4438

4539
let cfg: Config =
4640
toml::from_str(&std::fs::read_to_string("oay.toml").context("failed to open oay.toml")?)?;

bin/oay/src/bin/webdav.rs

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,16 +22,10 @@ use oay::services::WebdavService;
2222
use oay::Config;
2323
use opendal::services::Fs;
2424
use opendal::Operator;
25-
use tracing_subscriber::fmt;
26-
use tracing_subscriber::prelude::*;
27-
use tracing_subscriber::EnvFilter;
2825

2926
#[tokio::main]
3027
async fn main() -> Result<()> {
31-
tracing_subscriber::registry()
32-
.with(fmt::layer().pretty())
33-
.with(EnvFilter::from_default_env())
34-
.init();
28+
logforth::stderr().apply();
3529

3630
let cfg: Config = Config {
3731
backend: oay::BackendConfig {

bin/oay/src/services/s3/service.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ use futures_util::StreamExt;
2929
use opendal::Operator;
3030
use serde::Deserialize;
3131
use serde::Serialize;
32-
use tracing::debug;
3332

3433
use crate::Config;
3534

@@ -81,7 +80,7 @@ async fn handle_list_objects(
8180
state: State<S3State>,
8281
params: Query<ListObjectsV2Params>,
8382
) -> Result<OkResponse, ErrorResponse> {
84-
debug!("got params: {:?}", params);
83+
log::debug!("got params: {:?}", params);
8584

8685
if !state.op.info().full_capability().list_with_start_after {
8786
return Err(ErrorResponse {

0 commit comments

Comments
 (0)