-
Notifications
You must be signed in to change notification settings - Fork 154
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update log.entry() to not use global logger (#1524)
Multiple log entries sharing a global logger can cause changes to the entries' loggers to escape to the global level. For example, if an entry is changed to output its log lines to a custom io.Writer, the global logger will also be changed to write logs the custom io.Writer. Also, when concurrent callers attempt to change the output target of their respective log entries, the global logger will end up with racey outputs. This change clones the global logger inside the log.entry() function and binds the clone logger to the entry instance. Signed-off-by: Ivan Sim <ivan.sim@kasten.io> Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
- Loading branch information
1 parent
f4c178d
commit a5627cd
Showing
2 changed files
with
97 additions
and
2 deletions.
There are no files selected for viewing
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
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