Documentation
¶
Index ¶
- func Debug(message string, fields map[string]interface{})
- func Error(message string, err error, fields map[string]interface{})
- func Fatal(message string, err error, fields Fields)
- func Info(message string, fields map[string]interface{})
- func InitLogger()
- func Warn(message string, fields map[string]interface{})
- type Fields
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func InitLogger ¶
func InitLogger()
InitLogger configures the logger with a standardized format and log level. With().Caller().Timestamp().Logger() is used to include the caller and timestamp in the log output. The log level can be set using the LOG_LEVEL environment variable. The log output can be redirected to a file by setting the LOG_PATH environment variable. If the LOG_PATH environment variable is not set, the log output will be directed to stdout. The log level defaults to Debug if the LOG_LEVEL environment variable is not set. The log file path defaults to log.log if the LOG_PATH environment variable is not set.
Types ¶
Click to show internal directories.
Click to hide internal directories.