log

package
v0.0.0-...-7d3b672 Latest Latest
Warning

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

Go to latest
Published: Jul 13, 2023 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	LOG_DEBUG = LogLevel(logrus.DebugLevel)
	LOG_INFO  = LogLevel(logrus.InfoLevel)
	LOG_WARN  = LogLevel(logrus.WarnLevel)
	LOG_ERROR = LogLevel(logrus.ErrorLevel)
)

Variables

This section is empty.

Functions

This section is empty.

Types

type LogLevel

type LogLevel logrus.Level

type Logger

type Logger interface {
	IsLevelEnabled(level LogLevel) bool
	Printf(format string, a ...interface{})
	Log(level LogLevel, format string, a ...interface{})
	Debug(format string, a ...interface{})
	Info(format string, a ...interface{})
	// Warn logs a message. The err field can be left `nil`, otherwise the logger will format it into the message.
	Warn(err error, format string, a ...interface{})
	// Error logs an error. The err field can be left `nil`, otherwise the logger will format it into the message.
	Error(err error, format string, a ...interface{})
	// Nested return a new logger instance. `name` is the extra prefix to be prepended to each message. Leaving it blank
	// will add no additional prefix. The new Logger will inherit the properties of the original.
	Nested(name string) Logger
	// GetConfig Returns a copy of the LoggerConfig associated with this Logger. This is meant to be used by the framework.
	GetConfig() *LoggerConfig
	// SetStream sets the output of this Logger. This is meant to be used by the framework.
	SetStream(config *LoggerStreamConfig)
}

Logger General logger interface, can be used anywhere

type LoggerConfig

type LoggerConfig struct {
	Path   string
	Prefix string
}

LoggerConfig config related to the Logger. This needs to be serializable, so it can be passed around over the wire.

type LoggerStreamConfig

type LoggerStreamConfig struct {
	Path   string
	Writer io.Writer
}

LoggerStreamConfig stream related config to set on a Logger

Jump to

Keyboard shortcuts

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