log error locations from plugin logger and don't overwrite in client

Signed-off-by: Steve Kriss <krisss@vmware.com>
This commit is contained in:
Steve Kriss
2019-03-19 17:13:45 -06:00
parent bd662ab613
commit ff2db31b32
5 changed files with 31 additions and 2 deletions

View File

@@ -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

View File

@@ -37,6 +37,7 @@ func TestNewLogger(t *testing.T) {
expectedHooks := []logrus.Hook{
(&logging.LogLocationHook{}).WithLoggerName("plugin"),
&logging.ErrorLocationHook{},
&logging.HcLogLevelHook{},
}