log

package
v1.6.0 Latest Latest
Warning

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

Go to latest
Published: May 28, 2024 License: Apache-2.0 Imports: 4 Imported by: 1

Documentation

Overview

Package log provides a logging facility that is used by this library, and which can be configured to piggyback on another logging facility where available. If not explicitly configured, this will log messages using the Go standar library log package, filtered according to the log level set in the `DD_LOG_LEVEL` environment variable (or `ERROR` if none is set).

Custom logger intergrations are configured by calling the SetBackend function.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Criticalf

func Criticalf(format string, args ...any) error

Errorf logs a message with format using the CRITICAL log level and returns an error containing the formatted log message.

func Debug

func Debug(format string, args ...any)

Debug logs a message with format using the DEBUG log level.

func Errorf

func Errorf(format string, args ...any) error

Errorf logs a message with format using the ERROR log level and returns an error containing the formatted log message.

func Info

func Info(format string, args ...any)

Info logs a message with format using the INFO log level.

func SetBackend

func SetBackend(newBackend Backend)

SetBackend replaces the active log backend with the provided one. Any nil function in the new backend will silently ignore any message logged at that level.

func Trace

func Trace(format string, args ...any)

Trace logs a message with format using the TRACE log level.

func Warn

func Warn(format string, args ...any)

Warn logs a message with format using the WARN log level.

Types

type Backend

type Backend struct {
	Trace     func(string, ...any)
	Debug     func(string, ...any)
	Info      func(string, ...any)
	Warn      func(string, ...any)
	Errorf    func(string, ...any) error
	Criticalf func(string, ...any) error
}

Jump to

Keyboard shortcuts

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