logger

package
v0.5.2 Latest Latest
Warning

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

Go to latest
Published: Mar 14, 2026 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	RequestIdKey = "X-Oneapi-Request-Id"
)

Variables

View Source
var Logger *zap.Logger

Functions

func FatalLog

func FatalLog(v ...any)

func LogDebug

func LogDebug(ctx context.Context, msg string)

func LogError

func LogError(ctx context.Context, msg string)

func LogInfo

func LogInfo(ctx context.Context, msg string)

func LogWarn

func LogWarn(ctx context.Context, msg string)

func SetupLogger

func SetupLogger()

func SysDebug

func SysDebug(s string)

func SysError

func SysError(s string)

func SysLog

func SysLog(s string)

Types

type LogEntry

type LogEntry struct {
	Timestamp time.Time
	Level     string
	Message   string
}

LogEntry represents a single log entry in memory

func GetLatestLogs

func GetLatestLogs(n int) ([]LogEntry, error)

GetLatestLogs gets the latest n logs from memory

type LogHistory

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

LogHistory stores the latest logs in memory

func (*LogHistory) AddEntry

func (lh *LogHistory) AddEntry(level, message string)

AddEntry adds a new log entry to the history

func (*LogHistory) GetLatestEntries

func (lh *LogHistory) GetLatestEntries(n int) []LogEntry

GetLatestEntries returns the latest n entries from the log history

Jump to

Keyboard shortcuts

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