logger

package
v0.5.7 Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2023 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package logger wrapper for zerolog

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ZeroConfig

type ZeroConfig struct {
	Level             string `envconfig:"LEVEL"`
	TimeFieldFormat   string `envconfig:"TIME_FIELD_FORMAT"`
	PrettyPrint       bool   `envconfig:"PRETTY_PRINT"`
	RedirectStdLogger bool   `envconfig:"REDIRECT_STD_LOGGER"`
	DisableSampling   bool   `envconfig:"DISABLE_SAMPLING"`
	ErrorStack        bool   `envconfig:"ERROR_STACK"`
	ShowCaller        bool   `envconfig:"SHOW_CALLER"`
}

ZeroConfig logger settings

type Zerolog

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

Zerolog object capable of interacting with Zerolog

func NewDefaultZerolog

func NewDefaultZerolog() *Zerolog

NewDefaultZerolog creates Zerolog with default settings

func NewZerolog

func NewZerolog(config ZeroConfig) *Zerolog

NewZerolog creates a new Zerolog

func (*Zerolog) Debug

func (l *Zerolog) Debug() *zerolog.Event

Debug starts a new message with debug level

func (*Zerolog) Error

func (l *Zerolog) Error() *zerolog.Event

Error starts a new message with error level

func (*Zerolog) Fatal

func (l *Zerolog) Fatal(v ...interface{})

Fatal sends the event with fatal level

func (*Zerolog) Fatalf

func (l *Zerolog) Fatalf(format string, v ...interface{})

Fatalf sends the event with formatted msg with fatal level

func (*Zerolog) Info

func (l *Zerolog) Info() *zerolog.Event

Info starts a new message with info level

func (*Zerolog) Panic

func (l *Zerolog) Panic() *zerolog.Event

Panic starts a new message with panic level

func (*Zerolog) Print

func (l *Zerolog) Print(v ...interface{})

Print sends the event with debug level

func (*Zerolog) Printf

func (l *Zerolog) Printf(format string, v ...interface{})

Printf sends the event with formatted msg with debug level

func (Zerolog) SubLogger

func (l Zerolog) SubLogger(zero zerolog.Logger) *Zerolog

SubLogger duplicates the current logger

func (*Zerolog) Warn

func (l *Zerolog) Warn() *zerolog.Event

Warn starts a new message with warn level

func (*Zerolog) With

func (l *Zerolog) With() zerolog.Context

With creates a child logger with the field added to its context

Jump to

Keyboard shortcuts

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