mirror of
https://github.com/vmware-tanzu/velero.git
synced 2026-01-05 04:55:22 +00:00
Merge pull request #1301 from skriss/plugins-error-location
log error locations from plugin logger and don't overwrite in client
This commit is contained in:
@@ -50,6 +50,9 @@ func newLogger() *logrus.Logger {
|
||||
// server logger that the location has been set within a hook.
|
||||
logger.Hooks.Add((&logging.LogLocationHook{}).WithLoggerName("plugin"))
|
||||
|
||||
// make sure we attempt to record the error location
|
||||
logger.Hooks.Add(&logging.ErrorLocationHook{})
|
||||
|
||||
// this hook adjusts the string representation of WarnLevel to "warn"
|
||||
// rather than "warning" to make it parseable by go-plugin within the
|
||||
// Velero server code
|
||||
|
||||
@@ -37,6 +37,7 @@ func TestNewLogger(t *testing.T) {
|
||||
|
||||
expectedHooks := []logrus.Hook{
|
||||
(&logging.LogLocationHook{}).WithLoggerName("plugin"),
|
||||
&logging.ErrorLocationHook{},
|
||||
&logging.HcLogLevelHook{},
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user