logging

package
v0.1.0-beta Latest Latest
Warning

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

Go to latest
Published: Jun 16, 2023 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Core

func Core(s LogStore, level zapcore.LevelEnabler) zapcore.Core

Core returns a new zapcore.Core that writes to the given LogStore.

Types

type Entry

type Entry struct {
	Timestamp time.Time       `json:"timestamp"`
	Level     zapcore.Level   `json:"level"`
	Name      string          `json:"name"`
	Caller    string          `json:"caller"`
	Message   string          `json:"message"`
	Fields    json.RawMessage `json:"fields"`
}

An Entry is a log entry.

type Filter

type Filter struct {
	Names   []string        `json:"names"`
	Callers []string        `json:"callers"`
	Levels  []zapcore.Level `json:"levels"`
	Before  time.Time       `json:"before"`
	After   time.Time       `json:"after"`

	Limit  int `json:"limit"`
	Offset int `json:"offset"`
}

A Filter filters log entries by name, level, and/or time.

type LogStore

type LogStore interface {
	AddEntries(entries []Entry) error
	LogEntries(filter Filter) ([]Entry, int, error)
}

A LogStore stores log entries.

Jump to

Keyboard shortcuts

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