Documentation
¶
Index ¶
- Constants
- Variables
- func FatalLog(v ...any)
- func LogDebug(ctx context.Context, msg string)
- func LogError(ctx context.Context, msg string)
- func LogInfo(ctx context.Context, msg string)
- func LogWarn(ctx context.Context, msg string)
- func SetupLogger()
- func SysDebug(s string)
- func SysError(s string)
- func SysLog(s string)
- type LogEntry
- type LogHistory
Constants ¶
View Source
const (
RequestIdKey = "X-Oneapi-Request-Id"
)
Variables ¶
View Source
var Logger *zap.Logger
Functions ¶
func SetupLogger ¶
func SetupLogger()
Types ¶
type LogEntry ¶
LogEntry represents a single log entry in memory
func GetLatestLogs ¶
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
Click to show internal directories.
Click to hide internal directories.