#[cfg(any(feature = "rusoto", feature = "rusoto_rustls"))]
#[tokio::main]
async fn main() {
use rusoto_core::Region;
use std::time::Duration;
use tracing_subscriber::{filter, fmt, layer::SubscriberExt, util::SubscriberInitExt};
let cw_client = rusoto_logs::CloudWatchLogsClient::new(Region::ApNortheast1);
let (cw_layer, cw_guard) = tracing_cloudwatch::layer().with_client(
cw_client,
tracing_cloudwatch::ExportConfig::default()
.with_batch_size(1)
.with_interval(Duration::from_secs(1))
.with_log_group_name("tracing-cloudwatch")
.with_log_stream_name("stream-1"),
);
tracing_subscriber::registry::Registry::default()
.with(fmt::layer().with_ansi(true))
.with(filter::LevelFilter::INFO)
.with(cw_layer)
.init();
start().await;
tokio::time::sleep(Duration::from_secs(5)).await;
cw_guard.shutdown().await;
}
#[cfg(all(not(feature = "rusoto"), not(feature = "rusoto_rustls")))]
fn main() {}
#[cfg(any(feature = "rusoto", feature = "rusoto_rustls"))]
#[tracing::instrument()]
async fn start() {
tracing::info!("Starting...");
}