Documentation
¶
Index ¶
- func Debug(format string, args ...any)
- func Error(format string, args ...any)
- func Fatal(format string, args ...any)
- func Info(format string, args ...any)
- func InitGlobalLogger(appName string, level string)
- func Panic(format string, args ...any)
- func SetOutput(w io.Writer)
- func Warn(format string, args ...any)
- type Logger
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func InitGlobalLogger ¶
InitGlobalLogger creates a new logger with specified appName and log level It also sets the new logger as built in logger This should be called prior to calling any of the log methods
Types ¶
type Logger ¶
type Logger interface {
// BaseLogger returns the underlying logger implementation
BaseLogger() *zerolog.Logger
// SetOutput updates the current logger's output to specified io.Writer
// It also overrides the built-in logger with the updated logger
SetOutput(w io.Writer)
// Debug takes formatted message string and logs at Debug level
Debug(format string, args ...any)
// Info takes formatted message string and logs at Info level
Info(format string, args ...any)
// Warn takes formatted message string and logs at Warn level
Warn(format string, args ...any)
// Error takes formatted message string and logs at Error level
Error(format string, args ...any)
// Panic takes formatted message string and logs at Panic level. It then calls panic()
Panic(format string, args ...any)
// Fatal takes formatted message string and logs at Fatal level. It then calls os.Exit(1)
Fatal(format string, args ...any)
// With returns a new wrapped logger with additional context provided by a set
With(keyValues ...any) Logger
}
Logger provides common logging functionalities
Click to show internal directories.
Click to hide internal directories.