logger

package
v0.1.0-rc.3 Latest Latest
Warning

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

Go to latest
Published: Feb 18, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Errorw

func Errorw(msg string, kvs ...any)

Errorw logs an error message to the global logger.

func Infow

func Infow(msg string, kvs ...any)

Infow logs an informational message to the global logger.

func InitGlobal

func InitGlobal(consumer LogConsumer, outputs ...string) error

InitGlobal initializes the global logger using the specified consumer. Note that no synchronization is done here, which is why this must be done during the "init" step of the program.

func Sync

func Sync() error

Sync runs the global logger Sync routine. Meant to be run at the end of the app's execution.

Types

type LogConsumer

type LogConsumer func(t time.Time, message []byte) error

LogConsumer is supposed to consume log messages. The default usage routes logs to the storage.

Jump to

Keyboard shortcuts

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