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: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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