log

package
v2.4.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 23, 2022 License: MIT Imports: 4 Imported by: 1

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

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 Warn

func Warn(msg string, keysAndValues ...interface{})

Warn logs a message with some additional context.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL