logger

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jul 17, 2025 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

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

Functions

func Debug

func Debug(msg string, keyvals ...interface{})

Convenience functions for common log operations

func Error

func Error(msg string, keyvals ...interface{})

func Fatal

func Fatal(msg string, keyvals ...interface{})

func Info

func Info(msg string, keyvals ...interface{})

func Init

func Init(config *Config) error

Init initializes the global logger with the provided configuration

func Warn

func Warn(msg string, keyvals ...interface{})

func With

func With(keyvals ...interface{}) *log.Logger

With returns a new logger with the given key-value pairs

Types

type Config

type Config struct {
	Level      LogLevel
	Output     io.Writer
	TimeFormat string
	Prefix     string
	LogFile    string
	CurrentDir string // Current working directory for log file
	Version    string // Version of the application, can be set at runtime
}

Config holds the logger configuration

func DefaultConfig

func DefaultConfig() *Config

DefaultConfig returns a default logger configuration

type LogLevel

type LogLevel int

LogLevel represents the available log levels

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