lumo

package module
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Dec 26, 2025 License: MIT Imports: 10 Imported by: 0

README

Lumo is a simple logger for Go, designed for hobby projects and small applications. It focuses on keeping logs readable and easy on the eyes without requiring complex configuration.

  • Easy to read: Clear Rust-like formatting with colors to separate levels, timestamps, and messages.
  • Non-blocking: Logs are handled asynchronously in a background worker.
  • Simple context support: Attach variables to errors to see exactly what data caused a crash.
  • Pretty traces: Stack traces filter out Go runtime internals so you only see your code.

Lumo Example Log Output

Installation

go get github.com/amatsagu/lumo

Usage

Check cmd/demo/main.go.

[!NOTE]
Color logs were tested only on Linux. Lumo is expected to be used in smaller, hobby apps that likely only use standard os stdout and something like systemctl or docker to control app logs.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ChangeOutput

func ChangeOutput(w io.Writer)

func Close

func Close()

func Debug

func Debug(format string, args ...any)

func EnableDebug

func EnableDebug()

func EnableStackOnWarns

func EnableStackOnWarns()

Makes logger attach stack traces below warn logs.

func Error

func Error(format string, args ...any)

func ForceColors

func ForceColors(enable bool)

ForceColors affects the global color state.

func HidePackagePrefix

func HidePackagePrefix()

Makes logger only display function names in stack traces.

func Info

func Info(format string, args ...any)

func Panic

func Panic(format string, args ...any)

func Warn

func Warn(format string, args ...any)

Types

type LumoError

type LumoError struct {
	// contains filtered or unexported fields
}

Custom error wrapper that holds a stack trace and simple, additional context.

func WrapError

func WrapError(err error) *LumoError

func WrapString

func WrapString(format string, a ...any) *LumoError

func (*LumoError) Error

func (e *LumoError) Error() string

func (*LumoError) Include

func (e *LumoError) Include(label string, data any) *LumoError

func (*LumoError) Unwrap

func (e *LumoError) Unwrap() error

Directories

Path Synopsis
cmd
demo command

Jump to

Keyboard shortcuts

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