Skip to content

package logging

import "kaiju/systems/logging"

Functions

ToMap

func ToMap(logMessage string) map[string]string

Types

Event

struct

type Event struct {
    // Has unexported fields.
}

Event.Add

func (e *Event) Add(call func(string)) EventId

Event.Execute

func (e *Event) Execute(message string)

Event.IsEmpty

func (e Event) IsEmpty() bool

Event.Remove

func (e *Event) Remove(id EventId)

EventId

int64

type EventId = int64

LogStream

struct

type LogStream struct {
    OnInfo  Event
    OnWarn  TracedEvent
    OnError TracedEvent
}

Initialize

func Initialize(opts *slog.HandlerOptions) *LogStream

LogStream.Write

func (l *LogStream) Write(p []byte) (n int, err error)

RuntimeLogHandler

struct

type RuntimeLogHandler struct {
    slog.Handler
}

RuntimeLogHandler.Enabled

func (e *RuntimeLogHandler) Enabled(_ context.Context, level slog.Level) bool

TracedEvent

struct

type TracedEvent struct {
    // Has unexported fields.
}

TracedEvent.Add

func (e *TracedEvent) Add(call func(msg string, trace []string)) EventId

TracedEvent.Execute

func (e *TracedEvent) Execute(message string, trace []string)

TracedEvent.IsEmpty

func (e TracedEvent) IsEmpty() bool

TracedEvent.Remove

func (e *TracedEvent) Remove(id EventId)