diff options
author | Christopher Speller <crspeller@gmail.com> | 2018-06-25 12:33:13 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-06-25 12:33:13 -0700 |
commit | 1e5c432e1029601a664454388ae366ef69618d62 (patch) | |
tree | cb9e8bfb66640ac3b29c934bb2c3202d25aeb368 /model/bundle_info.go | |
parent | ecefa6cdd1e7376046bbec82c1b47f7756fea646 (diff) | |
download | chat-1e5c432e1029601a664454388ae366ef69618d62.tar.gz chat-1e5c432e1029601a664454388ae366ef69618d62.tar.bz2 chat-1e5c432e1029601a664454388ae366ef69618d62.zip |
MM-10702 Moving plugins to use hashicorp go-plugin. (#8978)
* Moving plugins to use hashicorp go-plugin.
* Tweaks from feedback.
Diffstat (limited to 'model/bundle_info.go')
-rw-r--r-- | model/bundle_info.go | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/model/bundle_info.go b/model/bundle_info.go index 6965159cc..7cb06701a 100644 --- a/model/bundle_info.go +++ b/model/bundle_info.go @@ -3,6 +3,8 @@ package model +import "github.com/mattermost/mattermost-server/mlog" + type BundleInfo struct { Path string @@ -11,6 +13,13 @@ type BundleInfo struct { ManifestError error } +func (b *BundleInfo) WrapLogger(logger *mlog.Logger) *mlog.Logger { + if b.Manifest != nil { + return logger.With(mlog.String("plugin_id", b.Manifest.Id)) + } + return logger.With(mlog.String("plugin_path", b.Path)) +} + // Returns bundle info for the given path. The return value is never nil. func BundleInfoForPath(path string) *BundleInfo { m, mpath, err := FindManifest(path) |