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 <torinsandall@gmail.com>
T
Torin Sandall committed
8b40acea0af747cdb128f623a93908cf25787fa1
Parent: 349c7a0