zerolog

package
v0.25.2 Latest Latest
Warning

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

Go to latest
Published: Oct 29, 2023 License: MIT Imports: 6 Imported by: 2

Documentation

Overview

Package zerolog is a wrapper of the original "github.com/rs/zerolog" library.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Log

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

Log is logging client.

func New

func New(level LogLevel, jsonFmt, color bool) *Log

New to create new logging client. Color is not working in json format.

func (*Log) Debug

func (l *Log) Debug(fmt string, args ...interface{})

Debug to print debug log.

func (*Log) Error

func (l *Log) Error(fmt string, args ...interface{})

Error to print error log.

func (*Log) Fatal

func (l *Log) Fatal(fmt string, args ...interface{})

Fatal to print fatal log. Will exit the program when called.

func (*Log) Info

func (l *Log) Info(fmt string, args ...interface{})

Info to print info log.

func (*Log) Log

func (l *Log) Log(fields map[string]interface{})

Log to print general log. Key `level` can be used to differentiate log level.

func (*Log) Panic

func (l *Log) Panic(fmt string, args ...interface{})

Panic to print panic log. Will print panic error stack and exit like panic().

func (*Log) Trace

func (l *Log) Trace(fmt string, args ...interface{})

Trace to print trace log.

func (*Log) Warn

func (l *Log) Warn(fmt string, args ...interface{})

Warn to print warn log.

type LogLevel

type LogLevel int8

LogLevel is level of log that will be printed. Will print level that is higher than your chosen one.

const (
	TraceLevel LogLevel = iota - 1
	DebugLevel
	InfoLevel
	WarnLevel
	ErrorLevel
	FatalLevel
	PanicLevel
	Disabled
)

Available log level.

Jump to

Keyboard shortcuts

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