obs

package
v0.260313.0-preview Latest Latest
Warning

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

Go to latest
Published: Mar 12, 2026 License: MPL-2.0 Imports: 4 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MemoryLogHook

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

MemoryLogHook is a logrus hook that stores log entries in an in-memory circular buffer.

func NewMemoryLogHook

func NewMemoryLogHook(maxEntries int) *MemoryLogHook

NewMemoryLogHook creates a new memory log hook with the specified maximum capacity.

func (*MemoryLogHook) AddWriter

func (h *MemoryLogHook) AddWriter(w io.Writer)

AddWriter adds a writer for tee output functionality.

func (*MemoryLogHook) Clear

func (h *MemoryLogHook) Clear()

Clear removes all log entries.

func (*MemoryLogHook) Fire

func (h *MemoryLogHook) Fire(entry *logrus.Entry) error

Fire processes each log entry.

func (*MemoryLogHook) GetEntries

func (h *MemoryLogHook) GetEntries() []*logrus.Entry

GetEntries returns all log entries in chronological order.

func (*MemoryLogHook) GetEntriesByLevel

func (h *MemoryLogHook) GetEntriesByLevel(level logrus.Level) []*logrus.Entry

GetEntriesByLevel returns log entries matching the specified level.

func (*MemoryLogHook) GetEntriesByLevelRange

func (h *MemoryLogHook) GetEntriesByLevelRange(minLevel, maxLevel logrus.Level) []*logrus.Entry

GetEntriesByLevelRange returns log entries within the specified level range.

func (*MemoryLogHook) GetEntriesSince

func (h *MemoryLogHook) GetEntriesSince(since time.Time) []*logrus.Entry

GetEntriesSince returns log entries after the specified time.

func (*MemoryLogHook) GetLatest

func (h *MemoryLogHook) GetLatest(n int) []*logrus.Entry

GetLatest returns the newest N log entries.

func (*MemoryLogHook) Levels

func (h *MemoryLogHook) Levels() []logrus.Level

Levels returns the log levels this hook processes.

func (*MemoryLogHook) Size

func (h *MemoryLogHook) Size() int

Size returns the current number of stored log entries.

Jump to

Keyboard shortcuts

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