logging

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jun 24, 2026 License: GPL-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LogPath

func LogPath(dbPath string) (string, error)

func ResolveEffectiveLevel

func ResolveEffectiveLevel(configured string, runOverride string, debug bool) string

Types

type Entry

type Entry struct {
	ID      int64     `json:"id"`
	Time    time.Time `json:"time" ts_type:"string"`
	Level   string    `json:"level"`
	Message string    `json:"message"`
}

type Level

type Level int
const (
	LevelError Level = iota
	LevelWarn
	LevelInfo
	LevelDebug
	LevelTrace
)

func ParseLevel

func ParseLevel(value string) (Level, error)

func (Level) String

func (l Level) String() string

type Logger

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

func New

func New(cfg config.LoggingConfig, dbPath string) (*Logger, error)

func NewWithLevel

func NewWithLevel(cfg config.LoggingConfig, dbPath string, override string) (*Logger, error)

func (*Logger) Close

func (l *Logger) Close() error

func (*Logger) Debugf

func (l *Logger) Debugf(format string, args ...any)

func (*Logger) Errorf

func (l *Logger) Errorf(format string, args ...any)

func (*Logger) Infof

func (l *Logger) Infof(format string, args ...any)

func (*Logger) Recent

func (l *Logger) Recent(limit int) []Entry

func (*Logger) Subscribe

func (l *Logger) Subscribe(buffer int) (int, <-chan Entry)

func (*Logger) Tracef

func (l *Logger) Tracef(format string, args ...any)

func (*Logger) Unsubscribe

func (l *Logger) Unsubscribe(id int)

func (*Logger) Warnf

func (l *Logger) Warnf(format string, args ...any)

Jump to

Keyboard shortcuts

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