log

package
v0.0.0-...-07d62d3 Latest Latest
Warning

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

Go to latest
Published: Sep 4, 2024 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// EnvDebug is the environment variable that's tested to see if debugging
	// should be turned on.
	EnvDebug = `FLU_DEBUG`

	// EnvDebugDieFast if set to true, die immediately for testing
	EnvDebugDieFast = `FLU_DEBUG_DIE_FAST`

	// EnvSentryUrl to use for logging application logs and errors
	EnvSentryUrl = `FLU_SENTRY_URL`

	// EnvSilentMode to enable when no logging should happen (including Fatal)
	EnvSilentMode = `FLU_SILENT`

	// sentryExitTime to take when exiting while logging
	SentryExitTime = 2 * time.Second
)
View Source
const (
	LoggingLevelDebug = "debug"
	LoggingLevelApp   = "app"
	LoggingLevelFatal = "fatal"
)
View Source
const LoggingServerContext = `logging`

LoggingServerContext is the context that we use in the error messages to identify logging related errors.

Variables

This section is empty.

Functions

func App

func App(k func(k *Log))

func Debug

func Debug(k func(k *Log))

func DebugEnabled

func DebugEnabled() bool

func Debugf

func Debugf(message string, format ...interface{})

func Fatal

func Fatal(k func(k *Log))

func RegisterShutdown

func RegisterShutdown(callback func())

RegisterShutdown to register a callback to occur when a process exits fatally

Types

type Log

type Log struct {
	Context string      `json:"context"`
	Message string      `json:"message"`
	Payload interface{} `json:"payload"`
}

func (*Log) Format

func (k *Log) Format(message string, format ...interface{})

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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