Closed tomcat323 closed 1 month ago
This pull request modifies a feature or fixes a bug, but it does not include a changelog entry. All pull requests that introduce new features or bug fixes must have a corresponding changelog item describing the changes.
This pull request implements a feature or fix, so it must include a changelog entry. See CONTRIBUTING.md#changelog for instructions.
For context this implementation is resulted from a discussion in a previous closed PR:
/retryBuilds
Problem
Log message can appear in output channels(such as Amazon Q Logs as shown), IDE Debug console, or write to pre-defined log file destinations. They come from all parts of our services and can amount to large and lengthy chunks quickly.
We don’t have a reliable way to identify log messages from various services and modules of our product. Some messages might have headers while others don’t, and the existing headers are hard-coded on a message by message basis, with no checks for consistency.
Solution
getLogger('S3').error('Something went wrong')
Would print:S3: Something went wrong
Implementation notes:
WinstonToolkitLogger
is renamed toToolkitLogger
to avoid confusion, since its our own logger not winston's. The log topic feature is added here.baseLogger
abstract class is created to make the existingNullLogger
,ConsoleLogger
, andToolkitLogger
cleaner and their responsibilities more obvious and compact.Test
andUnknown
, this will be expanded during migration of existing logger calls.License: I confirm that my contribution is made under the terms of the Apache 2.0 license.