Documentation
¶
Index ¶
- Variables
- func Debug(args ...interface{})
- func Debugf(format string, args ...interface{})
- func Error(args ...interface{})
- func Errorf(format string, args ...interface{})
- func Fatal(args ...interface{})
- func Fatalf(format string, args ...interface{})
- func Info(args ...interface{})
- func Infof(format string, args ...interface{})
- func Init(logFile string, logOut bool, logLevel string)
- func Progressf(format string, args ...interface{})
- func SetLogLevel(level string)
- func SubscribeToLog(stop chan int) <-chan []LogItem
- func Trace(args ...interface{})
- func Tracef(format string, args ...interface{})
- func Warn(args ...interface{})
- func Warnf(format string, args ...interface{})
- type LogItem
- type PluginLogLevel
- type PluginLogger
- type ProgressFormatter
Constants ¶
This section is empty.
Variables ¶
View Source
var (
TraceLevel = PluginLogLevel{
Name: "trace",
// contains filtered or unexported fields
}
DebugLevel = PluginLogLevel{
Name: "debug",
// contains filtered or unexported fields
}
InfoLevel = PluginLogLevel{
Name: "info",
// contains filtered or unexported fields
}
WarningLevel = PluginLogLevel{
Name: "warning",
// contains filtered or unexported fields
}
ErrorLevel = PluginLogLevel{
Name: "error",
// contains filtered or unexported fields
}
ProgressLevel = PluginLogLevel{
Name: "progress",
// contains filtered or unexported fields
}
NoneLevel = PluginLogLevel{
Name: "none",
}
)
Valid Level values.
View Source
var LogCache []LogItem
Functions ¶
func Init ¶
func Init(logFile string, logOut bool, logLevel string)
Init initialises the logger based on a logging configuration
func SetLogLevel ¶
func SetLogLevel(level string)
func SubscribeToLog ¶
func SubscribeToLog(stop chan int) <-chan []LogItem
Types ¶
type LogItem ¶
type LogItem struct {
Time time.Time `json:"time"`
Type string `json:"type"`
Message string `json:"message"`
}
func GetLogCache ¶
func GetLogCache() []LogItem
type PluginLogLevel ¶ added in v0.10.0
type PluginLogLevel struct {
Name string
// contains filtered or unexported fields
}
func DetectLogLevel ¶ added in v0.10.0
func DetectLogLevel(line string) (*PluginLogLevel, string)
DetectLogLevel returns the Level and the logging string for a provided line of plugin output. It parses the string for logging control characters and determines the log level, if present. If not present, the plugin output is returned unchanged with a nil Level.
func PluginLogLevelFromName ¶ added in v0.10.0
func PluginLogLevelFromName(name string) *PluginLogLevel
PluginLogLevelFromName returns the Level that matches the provided name or nil if the name does not match a valid value.
type PluginLogger ¶ added in v0.10.0
type PluginLogger struct {
Prefix string
DefaultLogLevel *PluginLogLevel
ProgressChan chan float64
}
func (*PluginLogger) HandlePluginStdErr ¶ added in v0.10.0
func (log *PluginLogger) HandlePluginStdErr(pluginStdErr io.ReadCloser)
func (*PluginLogger) HandleStderrLine ¶ added in v0.10.0
func (log *PluginLogger) HandleStderrLine(line string)
type ProgressFormatter ¶
type ProgressFormatter struct{}
Click to show internal directories.
Click to hide internal directories.