summaryrefslogtreecommitdiffstats
path: root/model/bundle_info.go
diff options
context:
space:
mode:
Diffstat (limited to 'model/bundle_info.go')
-rw-r--r--model/bundle_info.go9
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)