1
1
/// See https://github.com/awslabs/aws-lambda-rust-runtime for more info on Rust runtime for AWS Lambda
2
2
use lambda_runtime:: { handler_fn, Error } ;
3
- use log:: LevelFilter ;
4
3
use serde:: { Deserialize , Serialize } ;
5
4
use serde_json:: { json, Value } ;
6
- use simple_logger:: SimpleLogger ;
7
5
use std:: fs:: File ;
8
6
9
7
/// A simple Lambda request structure with just one field
@@ -51,13 +49,8 @@ impl std::fmt::Display for CustomError {
51
49
52
50
#[ tokio:: main]
53
51
async fn main ( ) -> Result < ( ) , Error > {
54
- // The runtime logging can be enabled here by initializing `log` with `simple_logger`
55
- // or another compatible crate. The runtime is using `tracing` internally.
56
- // You can comment out the `simple_logger` init line and uncomment the following block to
57
- // use `tracing` in the handler function.
58
- //
59
- SimpleLogger :: new ( ) . with_level ( LevelFilter :: Info ) . init ( ) . unwrap ( ) ;
60
- /*
52
+ // The runtime logging can be enabled here by initializing `tracing` with `tracing-subscriber`
53
+ // While `tracing` is used internally, `log` can be used as well if preferred.
61
54
tracing_subscriber:: fmt ( )
62
55
. with_max_level ( tracing:: Level :: INFO )
63
56
// this needs to be set to false, otherwise ANSI color codes will
@@ -66,7 +59,6 @@ async fn main() -> Result<(), Error> {
66
59
// disabling time is handy because CloudWatch will add the ingestion time.
67
60
. without_time ( )
68
61
. init ( ) ;
69
- */
70
62
71
63
// call the actual handler of the request
72
64
let func = handler_fn ( func) ;
0 commit comments