Documentation
¶
Overview ¶
Package logger contains a common logger.
Index ¶
- Constants
- type DebugLogger
- type DebugfLogger
- type DefaultLogger
- func (l *DefaultLogger) Close()
- func (l *DefaultLogger) Debug(message string, fields ...Field)
- func (l *DefaultLogger) Debugf(format string, v ...any)
- func (l *DefaultLogger) Done()
- func (l *DefaultLogger) Error(err error, message string, fields ...Field)
- func (l *DefaultLogger) Errorf(err error, format string, v ...any)
- func (l *DefaultLogger) Fatal(message string, fields ...Field)
- func (l *DefaultLogger) Fatalf(format string, v ...any)
- func (l *DefaultLogger) Info(message string, fields ...Field)
- func (l *DefaultLogger) Infof(format string, v ...any)
- func (l *DefaultLogger) Warn(message string, fields ...Field)
- func (l *DefaultLogger) Warnf(format string, v ...any)
- type ErrorLogger
- type ErrorfLogger
- type FatalLogger
- type FatalfLogger
- type Field
- type Format
- type InfoLogger
- type InfofLogger
- type Level
- type Logger
- type Option
- type WarnLogger
- type WarnfLogger
Constants ¶
View Source
const ( // LevelDebug a debug level for the logger. LevelDebug Level = "debug" // LevelInfo an info level for the logger. LevelInfo Level = "info" // LevelWarn warning level for the logger. LevelWarn Level = "warning" // LevelError an error level for the logger. LevelError Level = "error" // LevelFatal an fatal level for the logger. LevelFatal Level = "fatal" // FormatText a simple text format for the log output. FormatText Format = "text" // FormatJSON a JSON format for the log output. FormatJSON Format = "json" // BufferSizeDefault async output buffer size. BufferSizeDefault = 1024 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DebugLogger ¶
type DebugfLogger ¶
DebugfLogger logger interface.
type DefaultLogger ¶
type DefaultLogger struct {
// contains filtered or unexported fields
}
DefaultLogger a common logger.
func (*DefaultLogger) Debug ¶
func (l *DefaultLogger) Debug(message string, fields ...Field)
Debug a common logger debug method.
func (*DefaultLogger) Debugf ¶
func (l *DefaultLogger) Debugf(format string, v ...any)
Debugf a common logger debug method.
func (*DefaultLogger) Error ¶
func (l *DefaultLogger) Error(err error, message string, fields ...Field)
Error a common logger debug method.
func (*DefaultLogger) Errorf ¶
func (l *DefaultLogger) Errorf(err error, format string, v ...any)
Errorf a common logger error method.
func (*DefaultLogger) Fatal ¶
func (l *DefaultLogger) Fatal(message string, fields ...Field)
Fatal a common logger debug method.
func (*DefaultLogger) Fatalf ¶
func (l *DefaultLogger) Fatalf(format string, v ...any)
Fatalf a common logger error method.
func (*DefaultLogger) Info ¶
func (l *DefaultLogger) Info(message string, fields ...Field)
Info a common logger debug method.
func (*DefaultLogger) Infof ¶
func (l *DefaultLogger) Infof(format string, v ...any)
Infof a common logger info method.
func (*DefaultLogger) Warn ¶
func (l *DefaultLogger) Warn(message string, fields ...Field)
Warn a common logger debug method.
func (*DefaultLogger) Warnf ¶
func (l *DefaultLogger) Warnf(format string, v ...any)
Warnf a common logger warn method.
type ErrorLogger ¶
type ErrorfLogger ¶
ErrorfLogger error logger.
type FatalLogger ¶
type FatalfLogger ¶
FatalfLogger fatal logger.
type InfoLogger ¶
type InfofLogger ¶
InfofLogger info logger.
type Logger ¶
type Logger interface {
DebugLogger
InfoLogger
WarnLogger
ErrorLogger
FatalLogger
DebugfLogger
InfofLogger
WarnfLogger
ErrorfLogger
FatalfLogger
}
Logger is a logger interface.
type Option ¶
type Option func(logger *DefaultLogger)
Option to be used to build with optional deps.
type WarnLogger ¶
type WarnfLogger ¶
WarnfLogger warn logger.
Click to show internal directories.
Click to hide internal directories.