logging

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Mar 16, 2024 License: LGPL-2.1 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DefaultLogger

func DefaultLogger() *slog.Logger

DefaultLogger is a logger to which every gobject fallbacks if it's Log is not set by user

func NewDebugFileLogger

func NewDebugFileLogger(f *os.File) *slog.Logger

NewDebugFileLogger creates new logger which logs text messages into the given file with Debug level while also computing source of each message.

func NewDebugStdOutLogger

func NewDebugStdOutLogger() *slog.Logger

NewDebugStdOutLogger creates new logger which logs text messages into the standard output with Debug level while also computing source of each message.

func NewJSONLogger

func NewJSONLogger(w io.Writer, level slog.Level) *slog.Logger

NewJSONLogger creates a new logger which logs structured messages (JSON) of at least the level severity into the given writer.

func NewTextLogger

func NewTextLogger(w io.Writer, level slog.Level) *slog.Logger

NewTextLogger creates a new logger which logs text messages of at least the level severity into the given writer.

func NewThrowAwayLogger

func NewThrowAwayLogger() *slog.Logger

NewThrowAwayLogger creates new logger which throws everything away, i.e. a loggger which does not log anything. This behaviour propagates to any derived loggers.

func SetDefaultLogger

func SetDefaultLogger(logger *slog.Logger) error

SetDefaultLogger sets the DefaultLogger for every gobject with unset logger. Returns error on nil.

Types

This section is empty.

Jump to

Keyboard shortcuts

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