MCPcopy Create free account
hub / github.com/aws/aws-lambda-rust-runtime / main

Function main

examples/http-tower-trace/src/main.rs:14–26  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

12
13#[tokio::main]
14async fn main() -> Result<(), Error> {
15 // required to enable CloudWatch error logging by the runtime
16 tracing::init_default_subscriber();
17
18 let layer = TraceLayer::new_for_http()
19 .on_request(DefaultOnRequest::new().level(Level::INFO))
20 .on_response(DefaultOnResponse::new().level(Level::INFO));
21
22 let service = ServiceBuilder::new().layer(layer).service_fn(handler);
23
24 run(service).await?;
25 Ok(())
26}

Callers

nothing calls this directly

Calls 3

init_default_subscriberFunction · 0.85
runFunction · 0.50
layerMethod · 0.45

Tested by

no test coverage detected