Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: try use logforth #5573

Merged
merged 2 commits into from
Jan 27, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading