logger

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Nov 27, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Init

func Init(logLevel string, isService bool)

Init initializes the logger based on the given configuration

func IsService

func IsService() bool

IsService checks if the application is running as a service

func SetLogLevel

func SetLogLevel(level LogLevel)

SetLogLevel sets the global log level

Types

type LogEvent

type LogEvent struct {
	*zerolog.Event
}

func Debug

func Debug() *LogEvent

Debug logs a debug message

func Error

func Error() *LogEvent

Error logs an error message

func ErrorWithCode

func ErrorWithCode(err errors.Error) *LogEvent

ErrorWithCode logs an error message with a specific error code

func ErrorWithContext

func ErrorWithContext(err errors.Error, component, operation string) *LogEvent

func FatalWithCode

func FatalWithCode(err errors.Error) *LogEvent

FatalWithCode logs a fatal message with a specific error code and exits the program

func Info

func Info() *LogEvent

Info logs an info message

func Warn

func Warn() *LogEvent

Warn logs a warning message

func (*LogEvent) Msg

func (e *LogEvent) Msg(msg string)

func (*LogEvent) Send

func (e *LogEvent) Send()

type LogLevel

type LogLevel int8
const (
	DebugLevel LogLevel = iota
	InfoLevel
	WarnLevel
	ErrorLevel
	FatalLevel
)

Jump to

Keyboard shortcuts

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