log

package
v0.3.6 Latest Latest
Warning

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

Go to latest
Published: Nov 6, 2022 License: MIT Imports: 5 Imported by: 21

Documentation

Index

Constants

This section is empty.

Variables

View Source
var WithDeepCaller zerolog.Logger
View Source
var WithNoCaller zerolog.Logger

Functions

func ConsoleLogger

func ConsoleLogger() *zerolog.Logger

func Debug

func Debug() *zerolog.Event

Debug starts a new message with debug level.

You must call Msg on the returned event in order to send the event.

func DisableCaller

func DisableCaller()

func Error

func Error() *zerolog.Event

Error starts a new message with error level.

You must call Msg on the returned event in order to send the event.

func Fatal

func Fatal() *zerolog.Event

Fatal starts a new message with fatal level. The os.Exit(1) function is called by the Msg method.

You must call Msg on the returned event in order to send the event.

func FileLogger

func FileLogger(fileName string) *zerolog.Logger

FileLogger for product, height performance

func HandlerErrs

func HandlerErrs(errs ...error)

func Info

func Info() *zerolog.Event

Info starts a new message with info level.

You must call Msg on the returned event in order to send the event.

func Log

func Log() *zerolog.Event

Log starts a new message with no level. Setting zerolog.GlobalLevel to zerolog.Disabled will still disable events produced by this method.

You must call Msg on the returned event in order to send the event.

func Panic

func Panic() *zerolog.Event

Panic starts a new message with panic level. The message is also sent to the panic function.

You must call Msg on the returned event in order to send the event.

func PanicTrace

func PanicTrace() []byte

func Print

func Print(v ...interface{})

Print sends a log event using debug level and no extra field. Arguments are handled in the manner of fmt.Print.

func Printf

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

Printf sends a log event using debug level and no extra field. Arguments are handled in the manner of fmt.Printf.

func SetLevel

func SetLevel(l Level)

func SetLogger

func SetLogger(l *zerolog.Logger)

func Trace

func Trace() *zerolog.Event

Trace starts a new message with trace level.

You must call Msg on the returned event in order to send the event.

func Warn

func Warn() *zerolog.Event

Warn starts a new message with warn level.

You must call Msg on the returned event in order to send the event.

Types

type Level

type Level int8
const (
	// DebugLevel defines debug log level.
	DebugLevel Level = iota
	// InfoLevel defines info log level.
	InfoLevel
	// WarnLevel defines warn log level.
	WarnLevel
	// ErrorLevel defines error log level.
	ErrorLevel
	// FatalLevel defines fatal log level.
	FatalLevel
	// PanicLevel defines panic log level.
	PanicLevel
	// NoLevel defines an absent log level.
	NoLevel
	// Disabled disables the logger.
	Disabled

	// TraceLevel defines trace log level.
	TraceLevel Level = -1
)

func ParseLevel

func ParseLevel(s string) (Level, error)

func (Level) String

func (l Level) String() string

Jump to

Keyboard shortcuts

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