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 ¶
- func Debug(event string, detail logging.Pairs)
- func DebugOnce(key, event string, detail logging.Pairs) bool
- func DebugSynchronous(event string, detail logging.Pairs)
- func Error(event string, detail logging.Pairs)
- func ErrorOnce(key, event string, detail logging.Pairs) bool
- func ErrorSynchronous(event string, detail logging.Pairs)
- func Fatal(code int, event string, detail logging.Pairs)
- func HasDebuggedOnce(key string) bool
- func HasErroredOnce(key string) bool
- func HasInfoedOnce(key string) bool
- func HasLoggedOnce(logLevel level.Level, key string) bool
- func HasWarnedOnce(key string) bool
- func Info(event string, detail logging.Pairs)
- func InfoOnce(key, event string, detail logging.Pairs) bool
- func InfoSynchronous(event string, detail logging.Pairs)
- func Level() level.Level
- func Log(logLevel level.Level, event string, detail logging.Pairs)
- func LogOnce(logLevel level.Level, key, event string, detail logging.Pairs) bool
- func LogSynchronous(logLevel level.Level, event string, detail logging.Pairs)
- func Logger() logging.Logger
- func SetLogAsynchronous(asyncEnabled bool)
- func SetLogLevel(logLevel level.Level)
- func SetLogger(l logging.Logger)
- func Warn(event string, detail logging.Pairs)
- func WarnOnce(key, event string, detail logging.Pairs) bool
- func WarnSynchronous(event string, detail logging.Pairs)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DebugSynchronous ¶
Debug logs a DEBUG event to the package-level logger synchronously even if LogAsynchronous is true
func ErrorOnce ¶
Error logs an ERROR event to the package-level logger only once based on unique key
func ErrorSynchronous ¶
Error logs an ERROR event to the package-level logger synchronously even if LogAsynchronous is true
func Fatal ¶
Fatal logs a FATAL event to the package-level logger and exits the process with the provided exit code
func HasDebuggedOnce ¶
HasDebuggedOnce returns true if a Debug event for the provided key has been logged
func HasErroredOnce ¶
HasErroredOnce returns true if an Error event for the provided key has been logged
func HasInfoedOnce ¶
HasInfoedOnce returns true if an Info event for the provided key has been logged
func HasLoggedOnce ¶
HasLoggedOnce returns true if an event for the provided key has been logged at the provided level
func HasWarnedOnce ¶
HasWarnedOnce returns true if a Warn event for the provided key has been logged
func InfoSynchronous ¶
Info logs an INFO event to the package-level logger synchronously even if LogAsynchronous is true
func LogSynchronous ¶
LogSynchronous logs an event to the package-level logger synchronously even if LogAsynchronous is true
func SetLogAsynchronous ¶
func SetLogAsynchronous(asyncEnabled bool)
SetLogAsynchronous indicates whether log calls should be made synchronously (blocking) or asynchronously (non-blocking).
func SetLogLevel ¶
SetLogLevel sets the log level for the package-level logger
func WarnSynchronous ¶
Warn logs a WARN event to the package-level logger synchronously even if LogAsynchronous is true
Types ¶
This section is empty.