mirror of
https://github.com/stashapp/stash.git
synced 2025-12-24 01:03:24 +01:00
* init scrapper log levels * Refactor plugin logging Co-authored-by: WithoutPants <53250216+WithoutPants@users.noreply.github.com>
25 lines
519 B
Go
25 lines
519 B
Go
package plugin
|
|
|
|
import (
|
|
"io"
|
|
|
|
"github.com/stashapp/stash/pkg/logger"
|
|
)
|
|
|
|
func (t *pluginTask) handlePluginStderr(pluginOutputReader io.ReadCloser) {
|
|
logLevel := logger.PluginLogLevelFromName(t.plugin.PluginErrLogLevel)
|
|
if logLevel == nil {
|
|
// default log level to error
|
|
logLevel = &logger.ErrorLevel
|
|
}
|
|
|
|
const pluginPrefix = "[Plugin] "
|
|
|
|
lgr := logger.PluginLogger{
|
|
Prefix: pluginPrefix,
|
|
DefaultLogLevel: logLevel,
|
|
ProgressChan: t.progress,
|
|
}
|
|
|
|
lgr.HandlePluginStdErr(pluginOutputReader)
|
|
}
|