logger

package
v0.13.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 8, 2022 License: AGPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

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 Debug

func Debug(args ...interface{})

func Debugf

func Debugf(format string, args ...interface{})

func Error

func Error(args ...interface{})

func Errorf

func Errorf(format string, args ...interface{})

func Fatal

func Fatal(args ...interface{})

func Fatalf

func Fatalf(format string, args ...interface{})

func Info

func Info(args ...interface{})

func Infof

func Infof(format string, args ...interface{})

func Init

func Init(logFile string, logOut bool, logLevel string)

Init initialises the logger based on a logging configuration

func Progressf

func Progressf(format string, args ...interface{})

func SetLogLevel

func SetLogLevel(level string)

func SubscribeToLog

func SubscribeToLog(stop chan int) <-chan []LogItem

func Trace

func Trace(args ...interface{})

func Tracef added in v0.3.0

func Tracef(format string, args ...interface{})

func Warn

func Warn(args ...interface{})

func Warnf

func Warnf(format string, args ...interface{})

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.

func (PluginLogLevel) Log added in v0.10.0

func (l PluginLogLevel) Log(args ...interface{})

func (PluginLogLevel) Logf added in v0.10.0

func (l PluginLogLevel) Logf(format string, args ...interface{})

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{}

func (*ProgressFormatter) Format

func (f *ProgressFormatter) Format(entry *logrus.Entry) ([]byte, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL