-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
logging: Fix console logger instantiation
This commit fixes the console loggers so that messages are emitted regardless of the debug log level. The problem was that in 3fcc875 we updated the plugins to use a console logger obtained from the plugin manager as opposed to a global logger instantiated in the plugins package--the console logger obtained from the plugin manager was instantiated in the runtime package by calling logging.NewStandardLogger. Unfortunately, logging.NewStandardLogger does not create a new logger--it returns the global logrus logger. This commit fixes the issue by deprecating logging.NewStandardLogger and introducing two new functions in the logging package: * logging.Get() - this replaces the old logging.NewStandardLogger function--this function should be called to obtain the debug logger used throughout OPA. * logging.New() - this actually returns a new logger that can be configured independently from the debug logger used throughout OPA. The runtime and sdk packages have been updated to call logging.New() to obtain console loggers and the rest of the codebase has been updated to call logging.Get() in place of logging.NewStandardLogger(). Fixes #3654 Signed-off-by: Torin Sandall <[email protected]>
- Loading branch information
Showing
8 changed files
with
39 additions
and
27 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
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
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
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