Conversation
* WIP * Un-inline utf8.DecodeRuneInString * Base64 encoding for byte slices * Fuzzing * Looking good * Refactor string escape functions * Simplify writing base64 * Upd comment * Last funny stuff * Runby refactorings
Main goal of this change is to setup CI: testing and linting. - Added test and lint actions - Upgraded `golangci-lint` to version 2 - Made a demo command that replaced demo tests - Added code comments and otherwise pleased the linter
Displays the message in bold font.
Since JSON logger was introduced configuration no longer applies to both loggers equally with some options being unique to one or another logger. This change moves encoder-specific options to encoders themselves.
Allows for easier separation of concerns between console and JSON encoders.
Also changed default JSON field names.
- Consoler encoder prints levels in short uppercase format: `INFO`, `ERRO` - JSON encoder does it in full lowercase format: `info`, `error` - Fixed time key in JSON encoder
- `WithContext` is renamed to `ContextWithFields` - `FromContext` is renamed to `FieldsFromContext` New function names indicate their behavior in a clear and unambiguous way.
Buffers that grow over 10x the initial capacity are no longer returned into the pool and instead left to be garbage collected.
When context has fields but a call to logger doesn't, context fields are not displayed.
Replace 3 conditions with one lookup
This file contains hidden or 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
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.
Bunch of optimizations that make the logger ~20% faster on average workloads.
Fun fact:
log.Fcan only take 8 fields before it allocates memory.