From 17b1f0df627526d24eda100a2aeef5e3d4a8590d Mon Sep 17 00:00:00 2001 From: mlycore Date: Fri, 12 Aug 2022 13:27:22 +0800 Subject: [PATCH] chore(aws): remove unused code Signed-off-by: mlycore --- pisa-proxy/Cargo.lock | 3 +++ pisa-proxy/audit/aws/Cargo.toml | 5 ++++- pisa-proxy/audit/aws/src/aws.rs | 4 ++-- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/pisa-proxy/Cargo.lock b/pisa-proxy/Cargo.lock index 19a1679b..874f70db 100644 --- a/pisa-proxy/Cargo.lock +++ b/pisa-proxy/Cargo.lock @@ -261,6 +261,9 @@ dependencies = [ "aws-sdk-cloudwatchlogs", "chrono", "tokio", + "tracing", + "tracing-futures", + "tracing-subscriber", ] [[package]] diff --git a/pisa-proxy/audit/aws/Cargo.toml b/pisa-proxy/audit/aws/Cargo.toml index 04d3f60d..afaaeb21 100644 --- a/pisa-proxy/audit/aws/Cargo.toml +++ b/pisa-proxy/audit/aws/Cargo.toml @@ -9,4 +9,7 @@ edition = "2021" aws-config = "0.47.0" aws-sdk-cloudwatchlogs = { version = "0.17.0", default-features = false, features = ["rustls"]} chrono = "0.4.0" -tokio = { version = "1", features = ["full"] } \ No newline at end of file +tokio = { version = "1", features = ["full"] } +tracing = "0.1.13" +tracing-futures = { version = "0.2.3" } +tracing-subscriber = "0.3.9" \ No newline at end of file diff --git a/pisa-proxy/audit/aws/src/aws.rs b/pisa-proxy/audit/aws/src/aws.rs index 04e44bf9..e4f692ed 100644 --- a/pisa-proxy/audit/aws/src/aws.rs +++ b/pisa-proxy/audit/aws/src/aws.rs @@ -14,6 +14,7 @@ use aws_config::meta::region::RegionProviderChain; use aws_sdk_cloudwatchlogs::{model::InputLogEvent, Client}; +use tracing::trace; use chrono::Utc; pub struct CloudWatchLog { @@ -37,7 +38,6 @@ impl CloudWatchLog { pub struct CloudWatchSinker { pub client: Client, - // pub region: String, } impl CloudWatchSinker { @@ -73,7 +73,7 @@ impl CloudWatchSinker { .log_events(e) .send() .await?; - println!("aws resp {:?}", resp); + trace!("aws resp {:?}", resp); break; } }