logger

package
v0.0.0-...-6e4d8ea Latest Latest
Warning

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

Go to latest
Published: Jan 7, 2025 License: BSD-3-Clause Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddFileOutput

func AddFileOutput(logPath string) error

AddFileOutput adds a log file output

func Debug

func Debug(msg string, fields Fields)

Debug logs a debug message

func DebugN

func DebugN(msg string)

DebugN logs a debug message

func Error

func Error(msg string, err error, fields Fields)

Error logs an error message

func ErrorN

func ErrorN(msg string, err error)

ErrorN logs an error message

func Fatal

func Fatal(msg string, err error, fields Fields)

Fatal logs a fatal message and exits

func FatalN

func FatalN(msg string, err error)

FatalN logs a fatal message and exits

func GetLogger

func GetLogger() *zerolog.Logger

GetLogger returns the default logger instance

func Info

func Info(msg string, fields Fields)

Info logs an info message

func InfoN

func InfoN(msg string)

InfoN logs an info message

func SetLogLevel

func SetLogLevel(level zerolog.Level)

SetLogLevel sets the global log level

func Warn

func Warn(msg string, fields Fields)

Warn logs a warning message

func WarnN

func WarnN(msg string)

WarnN logs a warning message

func WithFields

func WithFields(fields Fields) *zerolog.Logger

WithFields creates a new logger with the given fields

Types

type Fields

type Fields map[string]interface{}

Fields type for structured logging

Jump to

Keyboard shortcuts

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