Skip to content
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

CC-1181: Add secondary prefix to logger #35

Merged
merged 4 commits into from
Jun 26, 2024
Merged

CC-1181: Add secondary prefix to logger #35

merged 4 commits into from
Jun 26, 2024

Conversation

ryan-gang
Copy link
Contributor

@ryan-gang ryan-gang commented Jun 24, 2024

This pull request primarily focuses on enhancing the logging functionality in the logger/logger.go file. The key changes include the addition of two new fields in the Logger struct, namely prefix and secondaryPrefix. These new fields allow for more dynamic log prefixing. Additionally, two new methods have been introduced, UpdateSecondaryPrefix and ResetSecondaryPrefix, to manage the secondary prefix.

Here are the key changes:

  • logger/logger.go: Added two new fields, prefix and secondaryPrefix, to the Logger struct. These fields are used to manage the prefixes for the logs.
  • logger/logger.go: Modified the GetLogger and GetQuietLogger functions to initialize the new prefix field.
  • logger/logger.go: Introduced a new method UpdateSecondaryPrefix that allows updating the secondary prefix and appending it to the primary prefix. If an empty string is passed, it resets the prefix to the original one.
  • logger/logger.go: Added a new method ResetSecondaryPrefix that resets the secondary prefix to an empty string.This pull request adds a new method, GetLoggerWithAppendedPrefix, which allows appending a secondary prefix to the existing logger prefix. Additionally, the existing UpdateSecondaryPrefix method has been refactored to dynamically update the secondary prefix, and a new ResetSecondaryPrefix method has been added to reset the secondary prefix to its original value. These changes enhance the flexibility and functionality of the logger.

Copy link

linear bot commented Jun 24, 2024

@ryan-gang ryan-gang self-assigned this Jun 24, 2024
logger/logger.go Outdated Show resolved Hide resolved
logger/logger.go Outdated Show resolved Hide resolved
@ryan-gang ryan-gang merged commit a750a92 into master Jun 26, 2024
1 check passed
@ryan-gang ryan-gang deleted the CC-1181 branch June 26, 2024 07:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants