MM-23261 plugin stderr debug logs (#14166)

* explicitly assert panic as error log

* Revert "[MM-18150] plugin panic trace should not be lost (#13559)"

This reverts commit 5d928b4f94, while leaving the unit tests intact
and now asserting debug logs instead.

* missing license header
Этот коммит содержится в:
Jesse Hallam
2020-03-30 15:00:45 -03:00
коммит произвёл GitHub
родитель 383e45b13d
Коммит f149ada16a
5 изменённых файлов: 36 добавлений и 23 удалений

Просмотреть файл

@@ -144,15 +144,6 @@ func (l *Logger) StdLogWriter() io.Writer {
return &loggerWriter{f}
}
// StdErrPanicLogWriter returns a writer that can be hooked up to the output of a golang standard logger
// all of the stderr will be interpreted as log entry.
func (l *Logger) StdErrPanicLogWriter() io.Writer {
newLogger := *l
newLogger.zap = newLogger.zap.WithOptions(zap.AddCallerSkip(4), getStdLogOption())
f := newLogger.Error
return &panicLoggerWriter{f}
}
func (l *Logger) WithCallerSkip(skip int) *Logger {
newlogger := *l
newlogger.zap = newlogger.zap.WithOptions(zap.AddCallerSkip(skip))

Просмотреть файл

@@ -85,13 +85,3 @@ func (l *loggerWriter) Write(p []byte) (int, error) {
}
return len(p), nil
}
type panicLoggerWriter struct {
logFunc func(msg string, fields ...Field)
}
func (l *panicLoggerWriter) Write(p []byte) (int, error) {
trimmed := string(bytes.TrimSpace(p))
l.logFunc(trimmed)
return len(p), nil
}