Documentation
¶
Index ¶
- Variables
- func Error(v ...interface{})
- func Errorf(format string, v ...interface{})
- func Fatal(v ...interface{})
- func Fatalf(format string, v ...interface{})
- func Info(v ...interface{})
- func Infof(format string, v ...interface{})
- func Panic(v ...interface{})
- func Panicf(format string, v ...interface{})
- func Warning(v ...interface{})
- func Warningf(format string, v ...interface{})
- type Level
- type Log
- func (l *Log) Debug(v ...any)
- func (l *Log) Debugf(format string, v ...any)
- func (l *Log) Error(v ...any)
- func (l *Log) Errorf(format string, v ...any)
- func (l *Log) Fatal(v ...any)
- func (l *Log) Fatalf(format string, v ...any)
- func (l *Log) Info(v ...any)
- func (l *Log) Infof(format string, v ...any)
- func (l *Log) LogLevel() Level
- func (l *Log) Panic(v ...any)
- func (l *Log) Panicf(format string, v ...any)
- func (l *Log) Warn(v ...any)
- func (l *Log) Warnf(format string, v ...any)
- type Logger
Constants ¶
This section is empty.
Variables ¶
var DefaultLogger = New(InfoLevel, os.Stdout)
DefaultLogger represents the default Log to use This Log wraps zerolog under the hood
var DiscardLogger = New(InfoLevel, io.Discard)
Functions ¶
func Fatal ¶
func Fatal(v ...interface{})
Fatal logs to the FATAL level followed by a call to os.Exit(1).
func Fatalf ¶
func Fatalf(format string, v ...interface{})
Fatalf logs to the FATAL level followed by a call to os.Exit(1).
func Panic ¶
func Panic(v ...interface{})
Panic logs to the PANIC level followed by a call to panic().
Types ¶
type Level ¶
type Level int
Level specifies the log level
const ( // InfoLevel indicates Info log level. InfoLevel Level = iota // WarningLevel indicates Warning log level. WarningLevel // ErrorLevel indicates Error log level. ErrorLevel // FatalLevel indicates Fatal log level. FatalLevel // PanicLevel indicates Panic log level PanicLevel // DebugLevel indicates Debug log level DebugLevel InvalidLevel )
type Log ¶
Log implements Logger interface with the underlying zap as the underlying logging library
func (*Log) Fatal ¶
Fatal starts a new message with fatal level. The os.Exit(1) function is called which terminates the program immediately.
func (*Log) Fatalf ¶
Fatalf starts a new message with fatal level. The os.Exit(1) function is called which terminates the program immediately.
func (*Log) Panic ¶
Panic starts a new message with panic level. The panic() function is called which stops the ordinary flow of a goroutine.
type Logger ¶
type Logger interface {
// Info starts a new message with info level.
Info(...any)
// Infof starts a new message with info level.
Infof(string, ...any)
// Warn starts a new message with warn level.
Warn(...any)
// Warnf starts a new message with warn level.
Warnf(string, ...any)
// Error starts a new message with error level.
Error(...any)
// Errorf starts a new message with error level.
Errorf(string, ...any)
// Fatal starts a new message with fatal level. The os.Exit(1) function
// is called which terminates the program immediately.
Fatal(...any)
// Fatalf starts a new message with fatal level. The os.Exit(1) function
// is called which terminates the program immediately.
Fatalf(string, ...any)
// Panic starts a new message with panic level. The panic() function
// is called which stops the ordinary flow of a goroutine.
Panic(...any)
// Panicf starts a new message with panic level. The panic() function
// is called which stops the ordinary flow of a goroutine.
Panicf(string, ...any)
// Debug starts a new message with debug level.
Debug(...any)
// Debugf starts a new message with debug level.
Debugf(string, ...any)
// LogLevel returns the log level being used
LogLevel() Level
}
Logger represents an active logging object that generates lines of output to an io.Writer.