Documentation ¶
Overview ¶
Package log provides logger for logging various output messages in different formats, including color-coded terminal output and JSON.Gofr logger supports different log levels such as INFO, ERROR, WARN, DEBUG, or FATAL.
Index ¶
Constants ¶
View Source
const ( Fatal level = iota + 1 Error Warn Info Debug )
View Source
const GofrVersion = "1.0.0"
View Source
const LevelFetchInterval = 10 // In seconds
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Logger ¶
type Logger interface { Log(args ...interface{}) Logf(format string, a ...interface{}) Debug(args ...interface{}) Debugf(format string, a ...interface{}) Info(args ...interface{}) Infof(format string, a ...interface{}) Warn(args ...interface{}) Warnf(format string, a ...interface{}) Error(args ...interface{}) Errorf(format string, a ...interface{}) Fatal(args ...interface{}) Fatalf(format string, a ...interface{}) AddData(key string, value interface{}) }
Logger is an interface for level based logging
func NewCorrelationLogger ¶
NewCorrelationLogger creates and returns a new logger instance with a specified correlation ID.
func NewLogger ¶
func NewLogger() Logger
NewLogger creates and returns a new logger instance that implements the Logger interface.
func NewMockLogger ¶
Click to show internal directories.
Click to hide internal directories.