From 83a3ac089cff0d05559e6ba5c2c60b09f5cae176 Mon Sep 17 00:00:00 2001 From: Christopher Speller Date: Tue, 3 Jul 2018 09:58:28 -0700 Subject: 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 --- plugin/plugintest/api.go | 34 +++++++++++++++++++++++++++++++++- plugin/plugintest/hooks.go | 2 +- 2 files changed, 34 insertions(+), 2 deletions(-) (limited to 'plugin/plugintest') diff --git a/plugin/plugintest/api.go b/plugin/plugintest/api.go index 145fcbf9d..b9d8d7521 100644 --- a/plugin/plugintest/api.go +++ b/plugin/plugintest/api.go @@ -1,4 +1,4 @@ -// Code generated by mockery v1.0.0 +// Code generated by mockery v1.0.0. DO NOT EDIT. // Regenerate this file using `make plugin-mocks`. @@ -563,6 +563,38 @@ func (_m *API) LoadPluginConfiguration(dest interface{}) error { return r0 } +// LogDebug provides a mock function with given fields: msg, keyValuePairs +func (_m *API) LogDebug(msg string, keyValuePairs ...interface{}) { + var _ca []interface{} + _ca = append(_ca, msg) + _ca = append(_ca, keyValuePairs...) + _m.Called(_ca...) +} + +// LogError provides a mock function with given fields: msg, keyValuePairs +func (_m *API) LogError(msg string, keyValuePairs ...interface{}) { + var _ca []interface{} + _ca = append(_ca, msg) + _ca = append(_ca, keyValuePairs...) + _m.Called(_ca...) +} + +// LogInfo provides a mock function with given fields: msg, keyValuePairs +func (_m *API) LogInfo(msg string, keyValuePairs ...interface{}) { + var _ca []interface{} + _ca = append(_ca, msg) + _ca = append(_ca, keyValuePairs...) + _m.Called(_ca...) +} + +// LogWarn provides a mock function with given fields: msg, keyValuePairs +func (_m *API) LogWarn(msg string, keyValuePairs ...interface{}) { + var _ca []interface{} + _ca = append(_ca, msg) + _ca = append(_ca, keyValuePairs...) + _m.Called(_ca...) +} + // PublishWebSocketEvent provides a mock function with given fields: event, payload, broadcast func (_m *API) PublishWebSocketEvent(event string, payload map[string]interface{}, broadcast *model.WebsocketBroadcast) { _m.Called(event, payload, broadcast) diff --git a/plugin/plugintest/hooks.go b/plugin/plugintest/hooks.go index 0d335a626..790a5a993 100644 --- a/plugin/plugintest/hooks.go +++ b/plugin/plugintest/hooks.go @@ -1,4 +1,4 @@ -// Code generated by mockery v1.0.0 +// Code generated by mockery v1.0.0. DO NOT EDIT. // Regenerate this file using `make plugin-mocks`. -- cgit v1.2.3-1-g7c22