logger

package
v0.0.0-...-79df936 Latest Latest
Warning

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

Go to latest
Published: Dec 2, 2024 License: Apache-2.0 Imports: 7 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 Config

type Config struct {
	Level             string
	TimeFormat        string
	PrettyPrint       bool
	RedirectStdLogger bool
	DisableSampling   bool
	ErrorStack        bool
}

Config logger settings

type Logger

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

Logger object capable of interacting with Logger

func New

func New(config Config) *Logger

New creates a new Logger

func NewDefault

func NewDefault() *Logger

NewDefault creates a new default Logger

func (*Logger) Debug

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

Debug starts a new message with debug level

func (*Logger) Error

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

Error starts a new message with error level

func (*Logger) Fatal

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

Fatal sends the event with fatal level

func (*Logger) Fatalf

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

Fatalf sends the event with formatted msg with fatal level

func (*Logger) Info

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

Info starts a new message with info level

func (*Logger) Panic

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

Panic starts a new message with panic level

func (*Logger) Print

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

Print sends the event with debug level

func (*Logger) Printf

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

Printf sends the event with formatted msg with debug level

func (*Logger) Warn

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

Warn starts a new message with warn level

func (*Logger) With

func (l *Logger) 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