logging

package
v0.0.0-...-8dc4135 Latest Latest
Warning

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

Go to latest
Published: Sep 24, 2020 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// Obsolete Logger instance for global debug-level logging. Retained for backward compatibility.
	// Deprecated: Use GlobalLoggers.
	Debug *log.Logger
	// Obsolete Logger instance for global info-level logging. Retained for backward compatibility.
	// Deprecated: Use GlobalLoggers.
	Info *log.Logger
	// Obsolete Logger instance for global warn-level logging. Retained for backward compatibility.
	// Deprecated: Use GlobalLoggers.
	Warning *log.Logger
	// Obsolete Logger instance for global error-level logging. Retained for backward compatibility.
	// Deprecated: Use GlobalLoggers.
	Error *log.Logger
)

Global package level loggers - these are preserved for backward compatibility, but in a future version they will be replaced by ldlog.Loggers. Output sent to these loggers does not have an environment name prefix, and is filtered by the logLevel/LOG_LEVEL parameter rather than by envLogLevel/ENV_LOG_LEVEL.

View Source
var GlobalLoggers ldlog.Loggers

Global logging object for Relay messages that are not tied to a specific environment. Use level-specific output methods such as Info/Infof, Warn/Warnf, tc.

Output sent here does not have an environment name prefix, and is filtered by the logLevel/LOG_LEVEL parameter rather than by envLogLevel/ENV_LOG_LEVEL.

The obsolete variables logging.Debug, logging.Info, etc. will still work, and will respect the log level configuration in terms of filtering, but will not include the level name in the output.

Functions

func InitLogging

func InitLogging(
	debugHandle io.Writer,
	infoHandle io.Writer,
	warningHandle io.Writer,
	errorHandle io.Writer)

InitLogging sets the destination streams for each logging level.

func InitLoggingWithLevel

func InitLoggingWithLevel(level ldlog.LogLevel)

InitLoggingWithLevel sets up the default logger configuration based on a minimum log level. This is the preferred method rather than InitLogging.

func MakeLoggers

func MakeLoggers(category string) ldlog.Loggers

MakeLoggers returns a ldlog.Loggers instance that uses the previously configured log writers, with an optional category description that will be prepended to messages.

func RequestLoggerMiddleware

func RequestLoggerMiddleware(next http.Handler) http.Handler

Types

This section is empty.

Jump to

Keyboard shortcuts

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