Skip to content

Commit d2e036d

Browse files
committed
Disable the ansi feature for tracing_subscriber instead of building with_ansi(false)
1 parent a00fe5d commit d2e036d

File tree

63 files changed

+30
-141
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

63 files changed

+30
-141
lines changed

examples/advanced-sqs-partial-batch-failures/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,4 @@ lambda_runtime = { path = "../../lambda-runtime" }
1313
tokio = { version = "1", features = ["macros"] }
1414
futures = "0.3"
1515
tracing = { version = "0.1", features = ["log"] }
16-
tracing-subscriber = { version = "0.3", default-features = false, features = ["ansi", "fmt"] }
16+
tracing-subscriber = { version = "0.3", default-features = false, features = ["fmt"] }

examples/advanced-sqs-partial-batch-failures/src/main.rs

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,6 @@ async fn main() -> Result<(), Error> {
3333
.with_max_level(tracing::Level::INFO)
3434
// disable printing the name of the module in every log line.
3535
.with_target(false)
36-
// this needs to be set to false, otherwise ANSI color codes will
37-
// show up in a confusing manner in CloudWatch logs.
38-
.with_ansi(false)
3936
// disabling time is handy because CloudWatch will add the ingestion time.
4037
.without_time()
4138
.init();
@@ -78,9 +75,7 @@ where
7875
tracing::trace!("Handling batch size {}", event.payload.records.len());
7976
let create_task = |msg| {
8077
// We need to keep the message_id to report failures to SQS
81-
let SqsMessageObj {
82-
message_id, body, ..
83-
} = msg;
78+
let SqsMessageObj { message_id, body, .. } = msg;
8479
let span = tracing::span!(tracing::Level::INFO, "Handling SQS msg", message_id);
8580
let task = async {
8681
//TODO catch panics like the `run` function from lambda_runtime
@@ -104,9 +99,7 @@ where
10499
}
105100
},
106101
)
107-
.map(|id| BatchItemFailure {
108-
item_identifier: id,
109-
})
102+
.map(|id| BatchItemFailure { item_identifier: id })
110103
.collect();
111104

112105
Ok(SqsBatchResponse {

examples/basic-error-handling/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,6 @@ serde_json = "1.0.81"
1717
simple-error = "0.2.3"
1818
tokio = { version = "1", features = ["macros"] }
1919
tracing = { version = "0.1", features = ["log"] }
20-
tracing-subscriber = { version = "0.3", default-features = false, features = ["ansi", "fmt"] }
20+
tracing-subscriber = { version = "0.3", default-features = false, features = ["fmt"] }
2121

2222

examples/basic-error-handling/src/main.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,6 @@ async fn main() -> Result<(), Error> {
5454
.with_max_level(tracing::Level::INFO)
5555
// disable printing the name of the module in every log line.
5656
.with_target(false)
57-
// this needs to be set to false, otherwise ANSI color codes will
58-
// show up in a confusing manner in CloudWatch logs.
59-
.with_ansi(false)
6057
// disabling time is handy because CloudWatch will add the ingestion time.
6158
.without_time()
6259
.init();

examples/basic-lambda-external-runtime/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,4 @@ serde = "1.0.163"
1212
tokio = "1.28.2"
1313
tokio-test = "0.4.2"
1414
tracing = "0.1.37"
15-
tracing-subscriber = "0.3.17"
15+
tracing-subscriber = { version = "0.3", default-features = false, features = ["fmt"] }

examples/basic-lambda-external-runtime/src/main.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,6 @@ fn main() -> Result<(), io::Error> {
2929
.with_max_level(tracing::Level::INFO)
3030
// disable printing the name of the module in every log line.
3131
.with_target(false)
32-
// this needs to be set to false, otherwise ANSI color codes will
33-
// show up in a confusing manner in CloudWatch logs.
34-
.with_ansi(false)
3532
// disabling time is handy because CloudWatch will add the ingestion time.
3633
.without_time()
3734
.init();

examples/basic-lambda/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,5 @@ lambda_runtime = { path = "../../lambda-runtime" }
1515
serde = "1.0.136"
1616
tokio = { version = "1", features = ["macros"] }
1717
tracing = { version = "0.1", features = ["log"] }
18-
tracing-subscriber = { version = "0.3", default-features = false, features = ["ansi", "fmt"] }
18+
tracing-subscriber = { version = "0.3", default-features = false, features = ["fmt"] }
1919
tokio-test = "0.4.2"

examples/basic-lambda/src/main.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,6 @@ async fn main() -> Result<(), Error> {
2929
.with_max_level(tracing::Level::INFO)
3030
// disable printing the name of the module in every log line.
3131
.with_target(false)
32-
// this needs to be set to false, otherwise ANSI color codes will
33-
// show up in a confusing manner in CloudWatch logs.
34-
.with_ansi(false)
3532
// disabling time is handy because CloudWatch will add the ingestion time.
3633
.without_time()
3734
.init();

examples/basic-s3-object-lambda-thumbnail/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ lambda_runtime = { path = "../../lambda-runtime" }
2020
serde = "1"
2121
tokio = { version = "1", features = ["macros"] }
2222
tracing = { version = "0.1" }
23-
tracing-subscriber = { version = "0.3", default-features = false, features = ["ansi", "fmt"] }
23+
tracing-subscriber = { version = "0.3", default-features = false, features = ["fmt"] }
2424
aws-config = "0.55.3"
2525
aws-sdk-s3 = "0.28.0"
2626
thumbnailer = "0.4.0"

examples/basic-s3-object-lambda-thumbnail/src/main.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,9 +69,6 @@ async fn main() -> Result<(), Error> {
6969
.with_max_level(tracing::Level::TRACE)
7070
// disable printing the name of the module in every log line.
7171
.with_target(false)
72-
// this needs to be set to false, otherwise ANSI color codes will
73-
// show up in a confusing manner in CloudWatch logs.
74-
.with_ansi(false)
7572
// disabling time is handy because CloudWatch will add the ingestion time.
7673
.without_time()
7774
.init();

0 commit comments

Comments
 (0)