logger

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: Aug 9, 2022 License: ISC Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CloseLogRotator

func CloseLogRotator()

CloseLogRotator closes the log rotator.

func InitLogRotator

func InitLogRotator(logFile string)

InitLogRotator initializes the logging rotater to write logs to logFile and create roll files in the same directory. It must be called before the package-global log rotater variables are used.

func NewSubsystem

func NewSubsystem(subsystemTag string) slog.Logger

NewSubsystem registers and returns a new subsystem logger.

func SetLogLevel

func SetLogLevel(subsystemID string, logLevel string)

SetLogLevel sets the logging level for provided subsystem. Invalid subsystems are ignored. Uninitialized subsystems are dynamically created as needed.

func SetLogLevels

func SetLogLevels(logLevel string)

SetLogLevels sets the log level for all subsystem loggers to the passed level. It also dynamically creates the subsystem loggers as needed, so it can be used to initialize the logging system.

func SupportedSubsystems

func SupportedSubsystems() []string

SupportedSubsystems returns a sorted slice of the supported subsystems for logging purposes.

Types

type LogClosure

type LogClosure func() string

LogClosure is a closure that can be printed with %v to be used to generate expensive-to-create data for a detailed log level and avoid doing the work if the data isn't printed.

func NewLogClosure

func NewLogClosure(c func() string) LogClosure

NewLogClosure returns a new LogClosure.

func (LogClosure) String

func (c LogClosure) String() string

Jump to

Keyboard shortcuts

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