Documentation ¶
Index ¶
- Variables
- func Debug(format string, v ...interface{})
- func Error(format string, v ...interface{})
- func Info(format string, v ...interface{})
- func SetFilter(filter *logutils.LevelFilter)
- func SetFlags(flag int)
- func SetLevel(level logutils.LogLevel)
- func Trace(format string, v ...interface{})
- func Warn(format string, v ...interface{})
- type Logger
- type LoggerOpts
Constants ¶
This section is empty.
Variables ¶
View Source
var ( LogLevelTrace = logutils.LogLevel("TRCE") // trace log level LogLevelDebug = logutils.LogLevel("DBUG") // debug log level LogLevelInfo = logutils.LogLevel("INFO") // info log level LogLevelWarn = logutils.LogLevel("WARN") // warning log level LogLevelError = logutils.LogLevel("EROR") // error log level )
Functions ¶
Types ¶
type Logger ¶
type Logger interface { Trace(ctx context.Context, format string, v ...interface{}) Debug(ctx context.Context, format string, v ...interface{}) Info(ctx context.Context, format string, v ...interface{}) Warn(ctx context.Context, format string, v ...interface{}) Error(ctx context.Context, format string, v ...interface{}) SetFlags(flags int) SetFilter(filter *logutils.LevelFilter) GetFilter() (filter *logutils.LevelFilter) WithField(field, val string) Logger }
Interface for logger, you can implement your own logger with this.
func NewLogger ¶
func NewLogger(name string, opts *LoggerOpts) (logger Logger)
Create a named logger with specify options.
Click to show internal directories.
Click to hide internal directories.