-
Notifications
You must be signed in to change notification settings - Fork 36
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Disable log coloring #1595
Disable log coloring #1595
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #1595 +/- ##
=======================================
Coverage ? 67.31%
=======================================
Files ? 261
Lines ? 12380
Branches ? 0
=======================================
Hits ? 8333
Misses ? 3524
Partials ? 523 ☔ View full report in Codecov by Sentry. |
5c4d080
to
65b0cd1
Compare
if os.Getenv("LOG_NOCOLORS") == "true" { | ||
f.nf.NoColors = true | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's use this behaviour by default. I don't see any problems on our side. So if it's also fine for your side, let's do it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are you suggesting removing the verification process and adopting the f.nf.NoColors = true
behavior as the default?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, it's correct. I don't see any motivation for using these control symbols so we can just cut it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That would be fine from our side, I will update my commit accordingly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hello @denis-tingaikin,
I edited my commit and changed the default behavior based on the discussion. However, some of the CI tests failed, and upon reviewing the results, it seems that some expected outputs explicitly contain the control characters that I have removed.
...
--- FAIL: TestOutput (0.00s)
common_test.go:73:
Error Trace: /home/runner/work/sdk/sdk/pkg/networkservice/core/trace/traceconcise/common_test.go:73
Error: Not equal:
expected: "\x1b[36m [INFO] [id:conn-1] [type:networkService] \x1b[0mserver-reque...
...
Do you have any suggestions on how to proceed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since we're removing control characters from logs, we should also remove them from expectations in tests.
dcef1a8
to
34f2ed5
Compare
7ad16d8
to
307a9c8
Compare
@@ -1,4 +1,4 @@ | |||
// Copyright (c) 2021 Doc.ai and/or its affiliates. | |||
// Copyright (c) 2024 Doc.ai and/or its affiliates. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's better to use a year range (2021-2024) for these cases.
Please check other modified files
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay, I will update the files accordingly. What should I put into the header where it was
// Copyright (c) 2023 Cisco and/or its affiliates.
originally. Should I go with 2024
, 2023-2024
or just use 2021-2024
everywhere?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The first year should be the same.
So, you should use 2023-2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@bszirtes also feel free to use copyright holders related to your company ;)
For example,
// Copyright (c) 2023 Cisco and/or its affiliates.
//
// Copyright (c) 2024 My company and/or its affiliates.
//
The copyright header is correct for the linter.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have made updates to the headers.
NSM issue: networkservicemesh#1594 Signed-off-by: Botond Szirtes <botond.szirtes@est.tech>
307a9c8
to
4ab043b
Compare
…k@main PR link: networkservicemesh/sdk#1595 Commit: a9e38d9 Author: Botond Szirtes Date: 2024-03-19 10:04:55 +0100 Message: - Introducing option to disable log coloring (#1595) NSM issue: networkservicemesh/sdk#1594 Signed-off-by: NSMBot <nsmbot@networkservicmesh.io>
…k@main PR link: networkservicemesh/sdk#1595 Commit: a9e38d9 Author: Botond Szirtes Date: 2024-03-19 10:04:55 +0100 Message: - Introducing option to disable log coloring (#1595) NSM issue: networkservicemesh/sdk#1594 Signed-off-by: NSMBot <nsmbot@networkservicmesh.io>
…k@main PR link: networkservicemesh/sdk#1595 Commit: a9e38d9 Author: Botond Szirtes Date: 2024-03-19 10:04:55 +0100 Message: - Introducing option to disable log coloring (#1595) NSM issue: networkservicemesh/sdk#1594 Signed-off-by: NSMBot <nsmbot@networkservicmesh.io>
…k@main PR link: networkservicemesh/sdk#1595 Commit: a9e38d9 Author: Botond Szirtes Date: 2024-03-19 10:04:55 +0100 Message: - Introducing option to disable log coloring (#1595) NSM issue: networkservicemesh/sdk#1594 Signed-off-by: NSMBot <nsmbot@networkservicmesh.io>
…k@main PR link: networkservicemesh/sdk#1595 Commit: a9e38d9 Author: Botond Szirtes Date: 2024-03-19 10:04:55 +0100 Message: - Introducing option to disable log coloring (#1595) NSM issue: networkservicemesh/sdk#1594 Signed-off-by: NSMBot <nsmbot@networkservicmesh.io>
…k@main PR link: networkservicemesh/sdk#1595 Commit: a9e38d9 Author: Botond Szirtes Date: 2024-03-19 10:04:55 +0100 Message: - Introducing option to disable log coloring (#1595) NSM issue: networkservicemesh/sdk#1594 Signed-off-by: NSMBot <nsmbot@networkservicmesh.io>
…k@main PR link: networkservicemesh/sdk#1595 Commit: a9e38d9 Author: Botond Szirtes Date: 2024-03-19 10:04:55 +0100 Message: - Introducing option to disable log coloring (#1595) NSM issue: networkservicemesh/sdk#1594 Signed-off-by: NSMBot <nsmbot@networkservicmesh.io>
…k@main PR link: networkservicemesh/sdk#1595 Commit: a9e38d9 Author: Botond Szirtes Date: 2024-03-19 10:04:55 +0100 Message: - Introducing option to disable log coloring (#1595) NSM issue: networkservicemesh/sdk#1594 Signed-off-by: NSMBot <nsmbot@networkservicmesh.io>
…k@main PR link: networkservicemesh/sdk#1595 Commit: a9e38d9 Author: Botond Szirtes Date: 2024-03-19 10:04:55 +0100 Message: - Introducing option to disable log coloring (#1595) NSM issue: networkservicemesh/sdk#1594 Signed-off-by: NSMBot <nsmbot@networkservicmesh.io>
…k@main PR link: networkservicemesh/sdk#1595 Commit: a9e38d9 Author: Botond Szirtes Date: 2024-03-19 10:04:55 +0100 Message: - Introducing option to disable log coloring (#1595) NSM issue: networkservicemesh/sdk#1594 Signed-off-by: NSMBot <nsmbot@networkservicmesh.io>
…k@main PR link: networkservicemesh/sdk#1595 Commit: a9e38d9 Author: Botond Szirtes Date: 2024-03-19 10:04:55 +0100 Message: - Introducing option to disable log coloring (#1595) NSM issue: networkservicemesh/sdk#1594 Signed-off-by: NSMBot <nsmbot@networkservicmesh.io>
…k@main PR link: networkservicemesh/sdk#1595 Commit: a9e38d9 Author: Botond Szirtes Date: 2024-03-19 10:04:55 +0100 Message: - Introducing option to disable log coloring (#1595) NSM issue: networkservicemesh/sdk#1594 Signed-off-by: NSMBot <nsmbot@networkservicmesh.io>
…k@main PR link: networkservicemesh/sdk#1595 Commit: a9e38d9 Author: Botond Szirtes Date: 2024-03-19 10:04:55 +0100 Message: - Introducing option to disable log coloring (#1595) NSM issue: networkservicemesh/sdk#1594 Signed-off-by: NSMBot <nsmbot@networkservicmesh.io>
…k@main PR link: networkservicemesh/sdk#1595 Commit: a9e38d9 Author: Botond Szirtes Date: 2024-03-19 10:04:55 +0100 Message: - Introducing option to disable log coloring (#1595) NSM issue: networkservicemesh/sdk#1594 Signed-off-by: NSMBot <nsmbot@networkservicmesh.io>
…k@main PR link: networkservicemesh/sdk#1595 Commit: a9e38d9 Author: Botond Szirtes Date: 2024-03-19 10:04:55 +0100 Message: - Introducing option to disable log coloring (#1595) NSM issue: networkservicemesh/sdk#1594 Signed-off-by: NSMBot <nsmbot@networkservicmesh.io>
Description
Introduced an option to disable the coloring of the log messages and thus remove the control characters responsible for it, via an optionally defined environmental variable.
Issue link
#1594
How Has This Been Tested?
Types of changes