diff --git a/Cargo.lock b/Cargo.lock index 95d002f74..5c3f441da 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -267,6 +267,7 @@ dependencies = [ "base64 0.21.7", "clap 4.2.7", "const_format", + "env_logger 0.10.2", "kbs_protocol", "log", "prost 0.11.9", diff --git a/attestation-agent/attestation-agent/Cargo.toml b/attestation-agent/attestation-agent/Cargo.toml index 41096262f..b37463959 100644 --- a/attestation-agent/attestation-agent/Cargo.toml +++ b/attestation-agent/attestation-agent/Cargo.toml @@ -20,6 +20,7 @@ attester = { path = "../attester", default-features = false } base64.workspace = true clap = { workspace = true, features = ["derive"], optional = true } const_format = { workspace = true, optional = true } +env_logger = { workspace = true, optional = true } kbs_protocol = { path = "../kbs_protocol", default-features = false, optional = true } log.workspace = true prost = { workspace = true, optional = true } @@ -66,6 +67,6 @@ rust-crypto = ["kbs_protocol?/rust-crypto"] openssl = ["kbs_protocol?/openssl"] # Binary RPC type -bin = ["clap", "tokio/rt-multi-thread"] +bin = ["clap", "env_logger", "tokio/rt-multi-thread"] grpc = ["prost", "tonic", "tonic-build", "tokio/signal"] ttrpc = ["const_format", "dep:ttrpc", "ttrpc-codegen", "protobuf", "tokio/signal"] diff --git a/attestation-agent/attestation-agent/src/bin/grpc-aa/main.rs b/attestation-agent/attestation-agent/src/bin/grpc-aa/main.rs index c83104e41..0c8bcc14a 100644 --- a/attestation-agent/attestation-agent/src/bin/grpc-aa/main.rs +++ b/attestation-agent/attestation-agent/src/bin/grpc-aa/main.rs @@ -29,6 +29,7 @@ struct Cli { #[tokio::main] pub async fn main() -> Result<()> { + env_logger::init_from_env(env_logger::Env::new().default_filter_or("info")); let cli = Cli::parse(); let attestation_socket = cli.attestation_sock.parse::()?; diff --git a/attestation-agent/attestation-agent/src/bin/ttrpc-aa/main.rs b/attestation-agent/attestation-agent/src/bin/ttrpc-aa/main.rs index 989880e0a..719bdde4d 100644 --- a/attestation-agent/attestation-agent/src/bin/ttrpc-aa/main.rs +++ b/attestation-agent/attestation-agent/src/bin/ttrpc-aa/main.rs @@ -37,6 +37,7 @@ struct Cli { #[tokio::main] pub async fn main() -> Result<()> { + env_logger::init_from_env(env_logger::Env::new().default_filter_or("info")); let cli = Cli::parse(); if !Path::new(DEFAULT_UNIX_SOCKET_DIR).exists() {