Documentation
¶
Index ¶
- Constants
- func ConfigureFromEnv()
- func Debug(message string)
- func DebugC(component string, message string)
- func DebugCF(component string, message string, fields map[string]any)
- func DebugF(message string, fields map[string]any)
- func Debugf(message string, ss ...any)
- func DisableConsole()
- func DisableFileLogging()
- func EnableConsole()
- func EnableFileLogging(filePath string) error
- func Error(message string)
- func ErrorC(component string, message string)
- func ErrorCF(component string, message string, fields map[string]any)
- func ErrorF(message string, fields map[string]any)
- func Errorf(message string, ss ...any)
- func Fatal(message string)
- func FatalC(component string, message string)
- func FatalCF(component string, message string, fields map[string]any)
- func FatalF(message string, fields map[string]any)
- func Fatalf(message string, ss ...any)
- func Info(message string)
- func InfoC(component string, message string)
- func InfoCF(component string, message string, fields map[string]any)
- func InfoF(message string, fields map[string]any)
- func Infof(message string, ss ...any)
- func InitPanic(filePath string) (func(), error)
- func RecoverPanicNoExit(err any)
- func SetConsoleLevel(level LogLevel)
- func SetLevel(level LogLevel)
- func SetLevelFromString(s string)
- func Warn(message string)
- func WarnC(component string, message string)
- func WarnCF(component string, message string, fields map[string]any)
- func WarnF(message string, fields map[string]any)
- func Warnf(message string, ss ...any)
- type LogLevel
- type Logger
- func (b *Logger) Debug(v ...any)
- func (b *Logger) Debugf(format string, v ...any)
- func (b *Logger) Error(v ...any)
- func (b *Logger) Errorf(format string, v ...any)
- func (b *Logger) Fatalf(format string, v ...any)
- func (b *Logger) Info(v ...any)
- func (b *Logger) Infof(format string, v ...any)
- func (b *Logger) Log(msgL, caller int, format string, a ...any)
- func (b *Logger) Sync() error
- func (b *Logger) Warn(v ...any)
- func (b *Logger) Warnf(format string, v ...any)
- func (b *Logger) Warningf(format string, v ...any)
- func (b *Logger) WithLevels(levels map[int]LogLevel) *Logger
Constants ¶
View Source
const ( DEBUG = zerolog.DebugLevel INFO = zerolog.InfoLevel WARN = zerolog.WarnLevel ERROR = zerolog.ErrorLevel FATAL = zerolog.FatalLevel Component = "component" )
Variables ¶
This section is empty.
Functions ¶
func ConfigureFromEnv ¶ added in v0.2.5
func ConfigureFromEnv()
func DisableConsole ¶ added in v0.2.5
func DisableConsole()
func DisableFileLogging ¶
func DisableFileLogging()
func EnableConsole ¶ added in v0.2.5
func EnableConsole()
func EnableFileLogging ¶
func RecoverPanicNoExit ¶ added in v0.2.5
func RecoverPanicNoExit(err any)
func SetConsoleLevel ¶ added in v0.2.4
func SetConsoleLevel(level LogLevel)
func SetLevelFromString ¶ added in v0.2.4
func SetLevelFromString(s string)
SetLevelFromString sets the log level from a string value. If the string is empty or not a recognized level name, the current level is kept.
Types ¶
type LogLevel ¶
func ParseLevel ¶ added in v0.2.4
ParseLevel converts a case-insensitive level name to a LogLevel. Returns the level and true if valid, or (INFO, false) if unrecognized.
type Logger ¶
type Logger struct {
// contains filtered or unexported fields
}
Logger implements common Logger interface
func NewLogger ¶ added in v0.2.3
NewLogger creates a new logger instance with optional component name
func (*Logger) Log ¶ added in v0.2.3
Log logs a message at a given level with caller information the func name must be this because 3rd party loggers expect this msgL: message level (DEBUG, INFO, WARN, ERROR, FATAL) caller: unused parameter reserved for compatibility format: format string a: format arguments
Click to show internal directories.
Click to hide internal directories.