Cleanup usage of global logger (#26835)
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
92a6c6517d
Коммит
30d450c4d8
@@ -522,7 +522,7 @@ func (a *App) GetPlugins() (*model.PluginsResponse, *model.AppError) {
|
||||
|
||||
// GetMarketplacePlugins returns a list of plugins from the marketplace-server,
|
||||
// and plugins that are installed locally.
|
||||
func (a *App) GetMarketplacePlugins(filter *model.MarketplacePluginFilter) ([]*model.MarketplacePlugin, *model.AppError) {
|
||||
func (a *App) GetMarketplacePlugins(rctx request.CTX, filter *model.MarketplacePluginFilter) ([]*model.MarketplacePlugin, *model.AppError) {
|
||||
plugins := map[string]*model.MarketplacePlugin{}
|
||||
|
||||
if *a.Config().PluginSettings.EnableRemoteMarketplace && !filter.LocalOnly {
|
||||
@@ -539,7 +539,7 @@ func (a *App) GetMarketplacePlugins(filter *model.MarketplacePluginFilter) ([]*m
|
||||
return nil, appErr
|
||||
}
|
||||
|
||||
appErr = a.mergeLocalPlugins(plugins)
|
||||
appErr = a.mergeLocalPlugins(rctx, plugins)
|
||||
if appErr != nil {
|
||||
return nil, appErr
|
||||
}
|
||||
@@ -692,7 +692,7 @@ func (a *App) mergePrepackagedPlugins(remoteMarketplacePlugins map[string]*model
|
||||
}
|
||||
|
||||
// mergeLocalPlugins merges locally installed plugins to remote marketplace plugins list.
|
||||
func (a *App) mergeLocalPlugins(remoteMarketplacePlugins map[string]*model.MarketplacePlugin) *model.AppError {
|
||||
func (a *App) mergeLocalPlugins(rctx request.CTX, remoteMarketplacePlugins map[string]*model.MarketplacePlugin) *model.AppError {
|
||||
pluginsEnvironment := a.GetPluginsEnvironment()
|
||||
if pluginsEnvironment == nil {
|
||||
return model.NewAppError("GetMarketplacePlugins", "app.plugin.config.app_error", nil, "", http.StatusInternalServerError)
|
||||
@@ -718,7 +718,7 @@ func (a *App) mergeLocalPlugins(remoteMarketplacePlugins map[string]*model.Marke
|
||||
if plugin.Manifest.IconPath != "" {
|
||||
iconData, err = getIcon(filepath.Join(plugin.Path, plugin.Manifest.IconPath))
|
||||
if err != nil {
|
||||
a.Log().Warn("Error loading local plugin icon", mlog.String("plugin_id", plugin.Manifest.Id), mlog.String("icon_path", plugin.Manifest.IconPath), mlog.Err(err))
|
||||
rctx.Logger().Warn("Error loading local plugin icon", mlog.String("plugin_id", plugin.Manifest.Id), mlog.String("icon_path", plugin.Manifest.IconPath), mlog.Err(err))
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Ссылка в новой задаче
Block a user