Plugins: Add ability to enable debug logging per plugin (#45481) (#45485)

* use plugin ID in logger name

* retrigger

(cherry picked from commit bd0ff79e28)
This commit is contained in:
Will Browne 2022-02-16 18:22:10 +01:00 committed by GitHub
parent 51cd6f3cc5
commit a2b391912a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -4,6 +4,7 @@ import (
"context"
"encoding/json"
"errors"
"fmt"
"net/url"
"os"
"path"
@ -240,7 +241,7 @@ func createPluginBase(pluginJSON plugins.JSONData, class plugins.Class, pluginDi
Class: class,
}
plugin.SetLogger(logger.New("pluginID", plugin.ID))
plugin.SetLogger(log.New(fmt.Sprintf("plugin.%s", plugin.ID)))
setImages(plugin)
return plugin