-
Notifications
You must be signed in to change notification settings - Fork 8
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
Added/updated features #2
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
* SetLogLevel now takes integer arguments as well, README and tests updated appropiately * Adjusted SetLogLevel functionality SetLogLevel now only takes Level types as input Level types now use int instead of uint8 Added StringToLevel and IntToLevel for simpler conversions between primitives and Levels Changed tests and readme appropiately * Removed IntToLevel - IntToLevel was essentially equivalent to Level(int) so it was removed. - added validateLogLevel to eliminate repeated code * Removed unnecessary SetLogLevel call * Added more test cases - Added some SetLogLevel tests that take Level inputs - Removed StringToLevel call in SetLogLevel testing to eliminate error logging during testing - Added some StringToLevel tests to capture and test these errors * Updated readme with Level table Also moved StringToLevel test cases to be before their use in SetLogLevel test cases * Explicitly set each log level constant to its int value * Updated changes to constant * Fix spec name after changes Co-authored-by: Eoghan Russell <[email protected]> Co-authored-by: John Rey Juele <[email protected]> Co-authored-by: Eoghan Russell <[email protected]>
* Add SetOutput functionality This patch adds functionality to set output. When used any subseqent calls to SetLogOptions or SetLogFile will discard set output. Also previously set setting are discarded when we call SetOutput. * Update README.md
Eoghan1232
approved these changes
Nov 15, 2022
return fmt.Sprintf(p.prefixFormat, time.Now().Format(p.timeFormat), loggingLevel) | ||
} | ||
|
||
func SetPrefixer(p Prefixer) { |
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.
should we also have a "SetDefaultPrefixer()" function to set the default prefix in case we want to get back to default ?
adrianchiris
approved these changes
Nov 15, 2022
merging now. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Added: custom prefix functionality, set a custom prefix to logs
Added: SetOutput functionality, add optional io.Writer output
Updated: SetLogLevel parameters, accepts int/Level type