golog

package module
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Dec 25, 2025 License: MIT Imports: 1 Imported by: 1

README

Golog

A universal Go logging interface that provides a common abstraction layer for various logging backends.

Install

go get golog.qntx.fun

License

MIT

Documentation

Index

Constants

View Source
const (
	LevelTrace   = Level(zerolog.TraceLevel)
	LevelDebug   = Level(zerolog.DebugLevel)
	LevelInfo    = Level(zerolog.InfoLevel)
	LevelWarn    = Level(zerolog.WarnLevel)
	LevelError   = Level(zerolog.ErrorLevel)
	LevelFatal   = Level(zerolog.FatalLevel)
	LevelPanic   = Level(zerolog.PanicLevel)
	LevelNoLevel = Level(zerolog.NoLevel)
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Level added in v0.1.0

type Level zerolog.Level

Level represents a log severity level. Use the package variables as an enum.

func ParseLevel added in v0.1.0

func ParseLevel(level string) (Level, error)

ParseLevel parses a string-based level and returns the corresponding Level.

Supported strings are: DEBUG, INFO, WARN, ERROR, DPANIC, PANIC, FATAL, and their lower-case forms. Returns an error if the level is invalid.

func (Level) String added in v0.1.0

func (l Level) String() string

type Logger

type Logger interface {
	Trace(msg string)
	Tracef(format string, args ...any)
	Debug(msg string)
	Debugf(format string, args ...any)
	Info(msg string)
	Infof(format string, args ...any)
	Warn(msg string)
	Warnf(format string, args ...any)
	Error(msg string)
	Errorf(format string, args ...any)
	Fatal(msg string)
	Fatalf(format string, args ...any)
	Panic(msg string)
	Panicf(format string, args ...any)
	Level(level Level)
	GetLevel() Level
}

Logger defines the contract for logging operations.

Directories

Path Synopsis
example
basic command
file command
multi command
rotation command
thread command
Package zerolog provides an implementation of golog.Logger using rs/zerolog.
Package zerolog provides an implementation of golog.Logger using rs/zerolog.

Jump to

Keyboard shortcuts

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