logger

package
v2.0.4 Latest Latest
Warning

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

Go to latest
Published: Jul 3, 2026 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Overview

package logger provides a package-level logger for application-wide use, and provides all of the same functions of logging.Logger at the package level - except for Close() (because this logger should always be open). By default, the logger is a Console Logger @ INFO. Use SetLogger() to set the Logger object to any logging.Logger.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Debug

func Debug(event string, detail logging.Pairs)

Debug logs a DEBUG event to the package-level logger

func DebugOnce

func DebugOnce(key, event string, detail logging.Pairs) bool

Debug logs a DEBUG event to the package-level logger only once based on unique key

func DebugSynchronous

func DebugSynchronous(event string, detail logging.Pairs)

Debug logs a DEBUG event to the package-level logger synchronously even if LogAsynchronous is true

func Error

func Error(event string, detail logging.Pairs)

Error logs an ERROR event to the package-level logger

func ErrorOnce

func ErrorOnce(key, event string, detail logging.Pairs) bool

Error logs an ERROR event to the package-level logger only once based on unique key

func ErrorSynchronous

func ErrorSynchronous(event string, detail logging.Pairs)

Error logs an ERROR event to the package-level logger synchronously even if LogAsynchronous is true

func Fatal

func Fatal(code int, event string, detail logging.Pairs)

Fatal logs a FATAL event to the package-level logger and exits the process with the provided exit code

func HasDebuggedOnce

func HasDebuggedOnce(key string) bool

HasDebuggedOnce returns true if a Debug event for the provided key has been logged

func HasErroredOnce

func HasErroredOnce(key string) bool

HasErroredOnce returns true if an Error event for the provided key has been logged

func HasInfoedOnce

func HasInfoedOnce(key string) bool

HasInfoedOnce returns true if an Info event for the provided key has been logged

func HasLoggedOnce

func HasLoggedOnce(logLevel level.Level, key string) bool

HasLoggedOnce returns true if an event for the provided key has been logged at the provided level

func HasWarnedOnce

func HasWarnedOnce(key string) bool

HasWarnedOnce returns true if a Warn event for the provided key has been logged

func Info

func Info(event string, detail logging.Pairs)

Info logs an INFO event to the package-level logger

func InfoOnce

func InfoOnce(key, event string, detail logging.Pairs) bool

Info logs an INFO event to the package-level logger only once based on unique key

func InfoSynchronous

func InfoSynchronous(event string, detail logging.Pairs)

Info logs an INFO event to the package-level logger synchronously even if LogAsynchronous is true

func Level

func Level() level.Level

Level returns the current Log Level for the package-level logger

func Log

func Log(logLevel level.Level, event string, detail logging.Pairs)

Log logs an event to the package-level logger

func LogOnce

func LogOnce(logLevel level.Level, key, event string, detail logging.Pairs) bool

LogOnce logs an event to the package-level logger only once based on unique key

func LogSynchronous

func LogSynchronous(logLevel level.Level, event string, detail logging.Pairs)

LogSynchronous logs an event to the package-level logger synchronously even if LogAsynchronous is true

func Logger

func Logger() logging.Logger

Logger returns gthe Package-level Logger

func SetLogAsynchronous

func SetLogAsynchronous(asyncEnabled bool)

SetLogAsynchronous indicates whether log calls should be made synchronously (blocking) or asynchronously (non-blocking).

func SetLogLevel

func SetLogLevel(logLevel level.Level)

SetLogLevel sets the log level for the package-level logger

func SetLogger

func SetLogger(l logging.Logger)

SetLogger sets the package-level logger object

func Warn

func Warn(event string, detail logging.Pairs)

Warn logs a WARN event to the package-level logger

func WarnOnce

func WarnOnce(key, event string, detail logging.Pairs) bool

Warn logs a WARN event to the package-level logger only once based on unique key

func WarnSynchronous

func WarnSynchronous(event string, detail logging.Pairs)

Warn logs a WARN event to the package-level logger synchronously even if LogAsynchronous is true

Types

This section is empty.

Jump to

Keyboard shortcuts

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