diff options
author | Christopher Speller <crspeller@gmail.com> | 2018-07-03 09:58:28 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-07-03 09:58:28 -0700 |
commit | 83a3ac089cff0d05559e6ba5c2c60b09f5cae176 (patch) | |
tree | 51cc53c0a77cf455cf9d700a453b6d57f1604fdb /plugin/supervisor.go | |
parent | 3848cb7e79e019e2f0878d6e2377ad36b3c7ca43 (diff) | |
download | chat-83a3ac089cff0d05559e6ba5c2c60b09f5cae176.tar.gz chat-83a3ac089cff0d05559e6ba5c2c60b09f5cae176.tar.bz2 chat-83a3ac089cff0d05559e6ba5c2c60b09f5cae176.zip |
MM-11029 Adding plugin logging functionality. (#9034)
* Capturing stdout, stderr of plugins in logs.
* Cleanup go-plugin debug logs.
* Adding logging to plugin API
* Generating mocks.
* godoc convention
Diffstat (limited to 'plugin/supervisor.go')
-rw-r--r-- | plugin/supervisor.go | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/plugin/supervisor.go b/plugin/supervisor.go index 0471f7861..58a7aa783 100644 --- a/plugin/supervisor.go +++ b/plugin/supervisor.go @@ -5,7 +5,6 @@ package plugin import ( "fmt" - "os" "os/exec" "path/filepath" "strings" @@ -29,7 +28,7 @@ func NewSupervisor(pluginInfo *model.BundleInfo, parentLogger *mlog.Logger, apiI wrappedLogger := pluginInfo.WrapLogger(parentLogger) hclogAdaptedLogger := &HclogAdapter{ - wrappedLogger: wrappedLogger, + wrappedLogger: wrappedLogger.WithCallerSkip(1), extrasKey: "wrapped_extras", } @@ -50,8 +49,8 @@ func NewSupervisor(pluginInfo *model.BundleInfo, parentLogger *mlog.Logger, apiI HandshakeConfig: Handshake, Plugins: pluginMap, Cmd: exec.Command(executable), - SyncStdout: os.Stdout, - SyncStderr: os.Stdout, + SyncStdout: wrappedLogger.With(mlog.String("source", "plugin_stdout")).StdLogWriter(), + SyncStderr: wrappedLogger.With(mlog.String("source", "plugin_stderr")).StdLogWriter(), Logger: hclogAdaptedLogger, StartTimeout: time.Second * 3, }) |