logger

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jun 8, 2025 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsService

func IsService() bool

IsService checks if the application is running as a service

Types

type LogEvent

type LogEvent struct {
	*zerolog.Event
}

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
)

type Logger added in v0.2.0

type Logger interface {
	Debug() *LogEvent
	Info() *LogEvent
	Warn() *LogEvent
	Error() *LogEvent
	ErrorWithCode(err errors.Error) *LogEvent
	FatalWithCode(err errors.Error) *LogEvent
	ErrorWithContext(err errors.Error, component, operation string) *LogEvent
}

Logger defines the interface for logging operations.

func New added in v0.2.0

func New(logLevel string, isService bool) Logger

New initializes the logger based on the given configuration

Jump to

Keyboard shortcuts

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