Documentation
¶
Index ¶
- Constants
- func AppendMsg(b []byte, v ...any) []byte
- func AppendMsgf(b []byte, format string, v ...any) []byte
- func Binary(level Level, bin []byte, v ...any)
- func Binaryf(level Level, bin []byte, wrap int, format string, v ...any)
- func Check(cond bool, v ...any)
- func CheckLevel(level Level) bool
- func Checkf(cond bool, format string, v ...any)
- func Debug(v ...any)
- func Debugf(format string, v ...any)
- func Error(v ...any)
- func Errorf(format string, v ...any)
- func Fatal(v ...any)
- func Fatalf(format string, v ...any)
- func Info(v ...any)
- func Infof(format string, v ...any)
- func Notice(v ...any)
- func Noticef(format string, v ...any)
- func Printf(calldepth int, level Level, extra func(io.Writer) error, format string, ...) error
- func Println(calldepth int, level Level, extra func(io.Writer) error, v ...any) error
- func Stack(level Level, skip int, v ...any)
- func Stackf(level Level, skip int, format string, v ...any)
- func Temporary(v ...any)
- func Temporaryf(format string, v ...any)
- func Text(level Level, txt string, v ...any)
- func Textf(level Level, txt string, wrap int, format string, v ...any)
- func Verbose(v ...any)
- func Verbosef(format string, v ...any)
- func VeryVerbose(v ...any)
- func VeryVerbosef(format string, v ...any)
- func Warning(v ...any)
- func Warningf(format string, v ...any)
- func Wrap(logger *Logger, level Level) *log.Logger
- type Flags
- type Level
- type Logger
- func (l *Logger) Debug(v ...any)
- func (l *Logger) Debugf(format string, v ...any)
- func (l *Logger) Error(v ...any)
- func (l *Logger) Errorf(format string, v ...any)
- func (l *Logger) Fatal(v ...any)
- func (l *Logger) Fatalf(format string, v ...any)
- func (l *Logger) Info(v ...any)
- func (l *Logger) Infof(format string, v ...any)
- func (l *Logger) Level() Level
- func (l *Logger) Notice(v ...any)
- func (l *Logger) Noticef(format string, v ...any)
- func (l *Logger) Printf(calldepth int, level Level, extra func(io.Writer) error, format string, ...) error
- func (l *Logger) Println(calldepth int, level Level, extra func(io.Writer) error, v ...any) error
- func (l *Logger) SetFilePrefix(prefix string)
- func (l *Logger) SetFlags(flags Flags)
- func (l *Logger) SetLevel(level Level)
- func (l *Logger) SetOutput(t OutputType, v ...any)
- func (l *Logger) Temporary(v ...any)
- func (l *Logger) Temporaryf(format string, v ...any)
- func (l *Logger) Verbose(v ...any)
- func (l *Logger) Verbosef(format string, v ...any)
- func (l *Logger) VeryVerbose(v ...any)
- func (l *Logger) VeryVerbosef(format string, v ...any)
- func (l *Logger) Warning(v ...any)
- func (l *Logger) Warningf(format string, v ...any)
- type OutputType
- type WriteFlusher
Constants ¶
const ( FlagNone Flags = iota FlagUTC = 0x0001 FlagNanos = 0x0002 )
const ( TimeLayout = "2006-01-02T15:04:05-07:00" TimeLayoutUTC = "2006-01-02T15:04:05Z07:00" TimeLayoutNano = "2006-01-02T15:04:05.999999999-07:00" TimeLayoutUTCNano = "2006-01-02T15:04:05.999999999Z07:00" )
TimeLayout is a fixed-length layout conforming to both ISO 8601 and RFC 3339
Variables ¶
This section is empty.
Functions ¶
func AppendMsgf ¶
AppendMsgf appends a formatted message to the given byte slice.
func CheckLevel ¶
CheckLevel checks whether the given level is enabled.
func Fatal ¶
func Fatal(v ...any)
Fatal logs serious problems that are likely to cause the program to exit.
func Temporaryf ¶
Temporaryf prints debug message regardless of log level.
func VeryVerbose ¶
func VeryVerbose(v ...any)
VeryVerbose logs more details that may significantly impact performance. The prefix is 'V'.
func VeryVerbosef ¶
VeryVerbosef logs more details that may significantly impact performance. The prefix is 'V'.
Types ¶
type Logger ¶
type Logger struct {
// contains filtered or unexported fields
}
Logger represents a logger instance.
func (*Logger) Printf ¶
func (l *Logger) Printf(calldepth int, level Level, extra func(io.Writer) error, format string, v ...any) error
Printf is the low-level interface to write arbitrary log messages.
func (*Logger) SetFilePrefix ¶
SetFilePrefix sets the file prefix to be stripped from file paths in log messages.
func (*Logger) SetOutput ¶
func (l *Logger) SetOutput(t OutputType, v ...any)
SetOutput sets the output type and parameters for the logger.
func (*Logger) Temporaryf ¶
Temporaryf prints debug message regardless of log level.
func (*Logger) VeryVerbose ¶
VeryVerbose logs more details that may significantly impact performance. The prefix is 'V'.
func (*Logger) VeryVerbosef ¶
VeryVerbosef logs more details that may significantly impact performance. The prefix is 'V'.
type OutputType ¶
type OutputType int
const ( OutputDiscard OutputType = iota OutputTerminal OutputWriter OutputSyslog )
type WriteFlusher ¶
func NewWriteFlusher ¶
func NewWriteFlusher(w io.Writer) WriteFlusher