Cleanup usage of global logger (#26835)
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
92a6c6517d
Коммит
30d450c4d8
@@ -14,9 +14,10 @@ import (
|
||||
|
||||
"github.com/mattermost/mattermost/server/public/model"
|
||||
"github.com/mattermost/mattermost/server/public/shared/mlog"
|
||||
"github.com/mattermost/mattermost/server/public/shared/request"
|
||||
)
|
||||
|
||||
func (a *App) RegisterPluginForSharedChannels(opts model.RegisterPluginOpts) (remoteID string, err error) {
|
||||
func (a *App) RegisterPluginForSharedChannels(rctx request.CTX, opts model.RegisterPluginOpts) (remoteID string, err error) {
|
||||
// check for pluginID already registered
|
||||
rc, err := a.Srv().Store().RemoteCluster().GetByPluginID(opts.PluginID)
|
||||
if err != nil {
|
||||
@@ -28,7 +29,7 @@ func (a *App) RegisterPluginForSharedChannels(opts model.RegisterPluginOpts) (re
|
||||
|
||||
// if plugin is already registered then treat this as an update.
|
||||
if rc != nil {
|
||||
a.Log().Debug("Plugin already registered for Shared Channels",
|
||||
rctx.Logger().Debug("Plugin already registered for Shared Channels",
|
||||
mlog.String("plugin_id", opts.PluginID),
|
||||
mlog.String("remote_id", rc.RemoteId),
|
||||
)
|
||||
@@ -57,7 +58,7 @@ func (a *App) RegisterPluginForSharedChannels(opts model.RegisterPluginOpts) (re
|
||||
return "", err
|
||||
}
|
||||
|
||||
a.Log().Debug("Registered new plugin for Shared Channels",
|
||||
rctx.Logger().Debug("Registered new plugin for Shared Channels",
|
||||
mlog.String("plugin_id", opts.PluginID),
|
||||
mlog.String("remote_id", rcSaved.RemoteId),
|
||||
)
|
||||
|
||||
Ссылка в новой задаче
Block a user