log

package
v0.0.0-...-219ab8e Latest Latest
Warning

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

Go to latest
Published: Jun 22, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultLoggerFlag = log.Ldate | log.Ltime | log.Lmicroseconds
)

Variables

This section is empty.

Functions

func Debug

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

func Error

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

func Info

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

func SetDefaultLogger

func SetDefaultLogger(logger *Logger)

func Trace

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

func Warn

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

Types

type LogLevel

type LogLevel int
const (
	LogLevelError LogLevel = iota
	LogLevelWarn
	LogLevelInfo
	LogLevelDebug
	LogLevelTrace
)

func ParseLogLevel

func ParseLogLevel(level string) (LogLevel, error)

ParseLogLevel parses a log level string into a LogLevel. Valid log levels are: error, warn, info, debug, trace.

func (LogLevel) String

func (level LogLevel) String() string

type Logger

type Logger struct {
	// contains filtered or unexported fields
}

func New

func New(out io.Writer, prefix string, flag int, level LogLevel) *Logger

func (*Logger) Debug

func (l *Logger) Debug(format string, args ...interface{})

func (*Logger) Error

func (l *Logger) Error(format string, args ...interface{})

func (*Logger) Info

func (l *Logger) Info(format string, args ...interface{})

func (*Logger) SetLevel

func (l *Logger) SetLevel(level LogLevel)

func (*Logger) Trace

func (l *Logger) Trace(format string, args ...interface{})

func (*Logger) Warn

func (l *Logger) Warn(format string, args ...interface{})

Jump to

Keyboard shortcuts

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