Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type LogFileDriver ¶
type LogFileDriver struct {
FilePath string
}
func (LogFileDriver) GetTarget ¶
func (f LogFileDriver) GetTarget() interface{}
type LogNullDriver ¶
type LogNullDriver struct{}
func (LogNullDriver) GetTarget ¶
func (n LogNullDriver) GetTarget() interface{}
type Logger ¶
type Logger struct {
// contains filtered or unexported fields
}
func NewLogger ¶
func NewLogger(driver LogsDriver) *Logger
NewLogger creates a new Logger with the given driver and a minimum level of DEBUG (all levels logged).
func NewLoggerWithLevel ¶ added in v1.9.7
func NewLoggerWithLevel(driver LogsDriver, minLevel Level) *Logger
NewLoggerWithLevel creates a new Logger with the given driver and minimum log level. Messages below the minimum level will be discarded. Stdout output is disabled by default.
func NewLoggerWithStdout ¶ added in v1.9.7
func NewLoggerWithStdout(driver LogsDriver, minLevel Level, stdoutEnabled bool) *Logger
NewLoggerWithStdout creates a new Logger with the given driver, minimum log level, and optionally writes to stdout in addition to the target file. When stdoutEnabled is true, log messages are written to both the target and stdout. ANSI color codes are applied to log prefixes in terminal output only.
func ResolveLogger ¶
func ResolveLogger() *Logger
type LogsDriver ¶
type LogsDriver interface {
GetTarget() interface{}
}
Click to show internal directories.
Click to hide internal directories.