fix: 去除anyhow的依赖

This commit is contained in:
shiro.lee
2024-08-06 22:59:28 +08:00
parent 24b3afbe3d
commit b007903616
5 changed files with 34 additions and 20 deletions
+16 -7
View File
@@ -11,19 +11,28 @@ rust-version.workspace = true
[dependencies]
async-trait.workspace = true
tracing.workspace = true
anyhow.workspace = true
time = { workspace = true, features = ["parsing", "formatting"] }
tokio = { workspace = true, features = ["rt-multi-thread", "macros", "net", "signal"] }
tokio = { workspace = true, features = [
"rt-multi-thread",
"macros",
"net",
"signal",
] }
tracing-error.workspace = true
http.workspace = true
bytes.workspace = true
futures.workspace = true
ecstore = { path = "../ecstore" }
s3s = "0.10.0"
clap = { version = "4.5.7", features = ["derive"] }
tracing-subscriber = { version = "0.3.18", features = ["env-filter", "time"] }
hyper-util = { version = "0.1.5", features = ["tokio", "server-auto", "server-graceful"] }
http.workspace = true
hyper-util = { version = "0.1.5", features = [
"tokio",
"server-auto",
"server-graceful",
] }
mime = "0.3.17"
bytes.workspace = true
transform-stream = "0.3.0"
futures.workspace = true
# pin-utils = "0.1.0"
+7 -2
View File
@@ -11,6 +11,8 @@ use s3s::{auth::SimpleAuth, service::S3ServiceBuilder};
use std::io::IsTerminal;
use tokio::net::TcpListener;
use tracing::{debug, info};
use tracing_error::ErrorLayer;
use tracing_subscriber::{fmt, layer::SubscriberExt, util::SubscriberInitExt};
fn setup_tracing() {
use tracing_subscriber::EnvFilter;
@@ -18,11 +20,14 @@ fn setup_tracing() {
let env_filter = EnvFilter::from_default_env();
let enable_color = std::io::stdout().is_terminal();
tracing_subscriber::fmt()
let subscriber = fmt()
.pretty()
.with_env_filter(env_filter)
.with_ansi(enable_color)
.init();
.finish()
.with(ErrorLayer::default());
subscriber.try_init().expect("failed to set global default subscriber");
}
fn main() -> Result<()> {