Skip to content

Commit

Permalink
chore: try use logforth (#5573)
Browse files Browse the repository at this point in the history
Signed-off-by: tison <[email protected]>
  • Loading branch information
tisonkun authored Jan 27, 2025
1 parent c811a30 commit c6fe050
Show file tree
Hide file tree
Showing 22 changed files with 271 additions and 244 deletions.
203 changes: 70 additions & 133 deletions bin/oay/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions bin/oay/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ chrono = "0.4.31"
dav-server = { version = "0.7", optional = true }
dav-server-opendalfs = { version = "0.3.0", path = "../../integrations/dav-server", optional = true }
futures-util = { version = "0.3.29", optional = true }
log = { version = "0.4.22" }
logforth = { version = "0.21.0", default-features = false }
opendal = { version = "0.51.0", path = "../../core", features = [
"services-fs",
] }
Expand All @@ -59,5 +61,3 @@ tokio = { version = "1.39", features = [
] }
toml = "0.8.12"
tower = { version = "0.4", features = ["util"] }
tracing = "0.1"
tracing-subscriber = { version = "0.3", features = ["env-filter"] }
8 changes: 1 addition & 7 deletions bin/oay/src/bin/oay.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,6 @@ use oay::Config;
use opendal::services::Fs;
use opendal::Operator;
use opendal::Scheme;
use tracing_subscriber::fmt;
use tracing_subscriber::prelude::*;
use tracing_subscriber::EnvFilter;

#[tokio::main]
async fn main() -> Result<()> {
Expand All @@ -37,10 +34,7 @@ async fn main() -> Result<()> {
}

async fn s3() -> Result<()> {
tracing_subscriber::registry()
.with(fmt::layer().pretty())
.with(EnvFilter::from_default_env())
.init();
logforth::stderr().apply();

let cfg: Config =
toml::from_str(&std::fs::read_to_string("oay.toml").context("failed to open oay.toml")?)?;
Expand Down
8 changes: 1 addition & 7 deletions bin/oay/src/bin/webdav.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,10 @@ use oay::services::WebdavService;
use oay::Config;
use opendal::services::Fs;
use opendal::Operator;
use tracing_subscriber::fmt;
use tracing_subscriber::prelude::*;
use tracing_subscriber::EnvFilter;

#[tokio::main]
async fn main() -> Result<()> {
tracing_subscriber::registry()
.with(fmt::layer().pretty())
.with(EnvFilter::from_default_env())
.init();
logforth::stderr().apply();

let cfg: Config = Config {
backend: oay::BackendConfig {
Expand Down
3 changes: 1 addition & 2 deletions bin/oay/src/services/s3/service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ use futures_util::StreamExt;
use opendal::Operator;
use serde::Deserialize;
use serde::Serialize;
use tracing::debug;

use crate::Config;

Expand Down Expand Up @@ -81,7 +80,7 @@ async fn handle_list_objects(
state: State<S3State>,
params: Query<ListObjectsV2Params>,
) -> Result<OkResponse, ErrorResponse> {
debug!("got params: {:?}", params);
log::debug!("got params: {:?}", params);

if !state.op.info().full_capability().list_with_start_after {
return Err(ErrorResponse {
Expand Down
Loading

0 comments on commit c6fe050

Please sign in to comment.