Documentation ¶
Overview ¶
Package log provides configurable logging. It will detect if the process is running in kubernetes by searching for the "KUBERNETES_SERVICE_HOST" environment variable. If it is running in kubernetes it will output logs to stdout using json. If it is not running in kubernetes it will output logs in a standard single line readable format.
Additionally, you can set a LOG_LEVEL environment value to any of the following values, to retrieve only log levels from that level and above. The default log level is INFO for running in kubernetes and DEBUG when not.
FATAL ERROR WARN INFO DEBUG
Index ¶
- func Debug(msg string, keysAndValues ...interface{})
- func Error(msg string, keysAndValues ...interface{})
- func Fatal(msg string, keysAndValues ...interface{})
- func Info(msg string, keysAndValues ...interface{})
- func InitializeLogger(isTerminal bool, logLevel string) error
- func Warn(msg string, keysAndValues ...interface{})
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Debug ¶
func Debug(msg string, keysAndValues ...interface{})
Debug logs a message with some additional context.
func Error ¶
func Error(msg string, keysAndValues ...interface{})
Error logs a message with some additional context.
func Fatal ¶
func Fatal(msg string, keysAndValues ...interface{})
Fatal logs a message with some additional context, then calls os.Exit.
func Info ¶
func Info(msg string, keysAndValues ...interface{})
Info logs a message with some additional context.
func InitializeLogger ¶
Types ¶
This section is empty.