logger

package
v2.5.8 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Default = dlog.New(log.Default().Writer(), "", log.LstdFlags, os.Getenv("DEBUG") == "1")

Default is the default logger. It logs to stderr and debug logging can be enabled by setting the DEBUG environment variable to 1. For example:

DEBUG=1 slackdump
View Source
var Silent = silent{}

Silent is a logger that does not log anything.

Functions

func NewContext added in v2.5.8

func NewContext(ctx context.Context, l Interface) context.Context

Types

type Interface

type Interface interface {
	Debug(...any)
	Debugf(fmt string, a ...any)
	Debugln(...any)
	Print(...any)
	Printf(fmt string, a ...any)
	Println(...any)
	IsDebug() bool
}

Interface is the interface for a logger.

func FromContext added in v2.5.8

func FromContext(ctx context.Context) Interface

Jump to

Keyboard shortcuts

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