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

* Transit panic from debug to error

* Parse plugin's StdErr and output panic to the mlog.Error

* Add unit tests

* Change log test

* Remove buffer from logger

* Remove 'panic' string filter

* Change *Buffer to io.Writer

Co-authored-by: mattermod <mattermod@users.noreply.github.com>
This commit is contained in:
Shota Gvinepadze
2020-03-11 11:41:11 +04:00
committed by GitHub
parent 771574b652
commit 5d928b4f94
6 changed files with 76 additions and 6 deletions

View File

@@ -63,6 +63,7 @@ func newSupervisor(pluginInfo *model.BundleInfo, apiImpl API, parentLogger *mlog
HandshakeConfig: handshake,
Plugins: pluginMap,
Cmd: cmd,
Stderr: wrappedLogger.With(mlog.String("source", "plugin_stderr_panic")).StdErrPanicLogWriter(),
SyncStdout: wrappedLogger.With(mlog.String("source", "plugin_stdout")).StdLogWriter(),
SyncStderr: wrappedLogger.With(mlog.String("source", "plugin_stderr")).StdLogWriter(),
Logger: hclogAdaptedLogger,