logger

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Mar 25, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// Logger is the global logger instance
	Logger zerolog.Logger
)

Functions

func Debug

func Debug(msg string)

Debug logs a debug message

func Debugf

func Debugf(format string, v ...interface{})

Debugf logs a formatted debug message

func Error

func Error(err error)

Error logs an error message

func Errorf

func Errorf(format string, v ...interface{})

Errorf logs a formatted error message

func Event

func Event(eventType, path string)

Event creates a colored event log for file system events

func Fatal

func Fatal(err error)

Fatal logs a fatal message and exits

func Fatalf

func Fatalf(format string, v ...interface{})

Fatalf logs a formatted fatal message and exits

func Info

func Info(msg string)

Info logs an info message

func Infof

func Infof(format string, v ...interface{})

Infof logs a formatted info message

func Init

func Init(opts ...Option)

Init initializes the logger with the given options

func Warn

func Warn(msg string)

Warn logs a warning message

func Warnf

func Warnf(format string, v ...interface{})

Warnf logs a formatted warning message

Types

type Option

type Option func(*Options)

Option is a function that configures Options

func WithColors

func WithColors(colors bool) Option

WithColors enables or disables colors in pretty logging

func WithLevel

func WithLevel(level zerolog.Level) Option

WithLevel sets the log level

func WithOutput

func WithOutput(output io.Writer) Option

WithOutput sets the output writer

func WithPretty

func WithPretty(pretty bool) Option

WithPretty enables or disables pretty logging

func WithTimeField

func WithTimeField(field string) Option

WithTimeField sets the time field name

type Options

type Options struct {
	Level     zerolog.Level
	Pretty    bool
	Colors    bool
	TimeField string
	Output    io.Writer
}

Options contains logger configuration options

Jump to

Keyboard shortcuts

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