timber

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Oct 5, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

Package timber contains logging utilities.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CleanLogDir

func CleanLogDir(keepEntries int) error

CleanLogDir removes old log entries to keep the directory clean. keepEntries specifies the number of entries to keep; 0 means all entries.

func ComponentLogger

func ComponentLogger(component string) zerolog.Logger

ComponentLogger returns a logger with a pre-configured "component" field. Used to have consistent fields across the various structs that need logging.

func CreateLogger

func CreateLogger(level zerolog.Level) (zerolog.Logger, func())

CreateLogger returns a zerolog.Logger writing to a log file and stderr, along with a cleanup function to close the underlying log file.

func OpenLogFile

func OpenLogFile() (io.WriteCloser, error)

OpenLogFile opens the log file for writing.

Types

This section is empty.

Jump to

Keyboard shortcuts

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