zlog

package module
v0.0.0-...-0e1f424 Latest Latest
Warning

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

Go to latest
Published: Mar 16, 2024 License: GPL-3.0 Imports: 5 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewConsoleLogger

func NewConsoleLogger() logz.Logger

NewConsoleLogger initializes a logger with a github.com/rs/zerolog backend, configured to produce a nice colored output for usage in console applications (do not use this logger for production-grade high-log-throughput applications).

func NewConsoleLoggerStderr

func NewConsoleLoggerStderr() logz.Logger

NewConsoleLoggerStderr is the same as NewConsoleLogger, but writes on stderr instead of stdout.

func NewJSONLogger

func NewJSONLogger() logz.Logger

NewJSONLogger initializes a logger with a github.com/rs/zerolog backend, configured to produce json-formatted logs for high-log-throughput applications.

Types

type Logger

type Logger struct {
	// contains filtered or unexported fields
}

Logger is a git.sr.ht/~blallo/logz.Logger with a github.com/rs/zerolog backend. It might be used both as a json logger or a nicely colored console logger.

func (*Logger) Debug

func (l *Logger) Debug(data map[string]interface{})

func (*Logger) Err

func (l *Logger) Err(data map[string]interface{})

func (*Logger) Info

func (l *Logger) Info(data map[string]interface{})

func (*Logger) Log

func (l *Logger) Log(level logz.LogLevel, data map[string]interface{})

func (*Logger) SetLevel

func (l *Logger) SetLevel(level logz.LogLevel) logz.Logger

func (*Logger) Trace

func (l *Logger) Trace(data map[string]interface{})

func (*Logger) Warn

func (l *Logger) Warn(data map[string]interface{})

Jump to

Keyboard shortcuts

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