log

package module
v0.0.0-...-11793f8 Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2021 License: MIT Imports: 9 Imported by: 0

README

log

Documentation

Index

Constants

View Source
const (
	RequestName  = "request"
	ResponseName = "response"
)

Variables

View Source
var (
	DurationAsString   = true
	RawFieldName       = "raw"
	DataFieldName      = "data"
	DurationFieldName  = "dur"
	DurationsFieldName = "durs"
	ErrorsFieldName    = "errors"

	EmptyMessage = ""
)

Functions

func Alert

func Alert(args ...interface{})

Panic logs a message at level Panic on the standard logger.

func AlertCaller

func AlertCaller(skip int, args ...interface{})

func CustomLevel

func CustomLevel(level string) *zerolog.Event

func Debug

func Debug(args ...interface{})

Debug logs a message at level Debug on the standard logger.

func DebugCaller

func DebugCaller(skip int, args ...interface{})

func DebugEvent

func DebugEvent() *zerolog.Event

func Error

func Error(err error, args ...interface{})

Error logs a message at level Error on the standard logger.

func ErrorCaller

func ErrorCaller(skip int, err error, args ...interface{})

func Fatal

func Fatal(err error, args ...interface{})

Fatal logs a message at level Fatal on the standard logger then the process will exit with status set to 1.

func FatalCaller

func FatalCaller(skip int, err error, args ...interface{})

func Info

func Info(args ...interface{})

Info logs a message at level Info on the standard logger.

func InfoCaller

func InfoCaller(skip int, args ...interface{})

func Log

func Log() *zerolog.Logger

func Notice

func Notice(args ...interface{})

Notice logs a message at level Notice on the standard logger.

func NoticeCaller

func NoticeCaller(skip int, args ...interface{})

NoticeCaller logs a message at level Notice on the standard logger.

func Panic

func Panic(err error, args ...interface{})

Panic logs a message at level Panic on the standard logger.

func PanicCaller

func PanicCaller(skip int, err error, args ...interface{})

func Print

func Print(args ...interface{})

Print logs a message at level Info on the standard logger.

func SetConsoleWriter

func SetConsoleWriter()

func SetJsonWriter

func SetJsonWriter()

func SetLogger

func SetLogger(logger zerolog.Logger)

func SetWriter

func SetWriter(w io.Writer)

func Trace

func Trace(args ...interface{})

Trace logs a message at level Trace on the standard logger.

func TraceCaller

func TraceCaller(skip int, args ...interface{})

func Warn

func Warn(args ...interface{})

Warn logs a message at level Warn on the standard logger.

func WarnCaller

func WarnCaller(skip int, args ...interface{})

func WarnErr

func WarnErr(err error, args ...interface{})

Error logs a message at level Error on the standard logger.

func WarnErrCaller

func WarnErrCaller(err error, skip int, args ...interface{})

Error logs a message at level Error on the standard logger.

Types

type Builder

type Builder func(event *zerolog.Event)

type JSON

type JSON []byte

Tag a byte slice as being a JSON document

type Request

type Request interface{}

type Response

type Response interface{}

Jump to

Keyboard shortcuts

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