logger

package module
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: May 30, 2026 License: MIT Imports: 6 Imported by: 0

README

logger

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Exporter

type Exporter interface {
	Export(item LogItem) error
}

Exporter defines the interface for custom log targets (SIEM, RPC, etc.)

type LogDispatcher

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

LogDispatcher manages the async pipeline and exporter registry.

func NewLogDispatcher

func NewLogDispatcher(serviceName string, bufferSize int, walPath string) (*LogDispatcher, error)

NewLogDispatcher initializes the pub/sub logging system.

func (*LogDispatcher) Audit

func (ld *LogDispatcher) Audit(actor, action, message string)

func (*LogDispatcher) Close

func (ld *LogDispatcher) Close()

func (*LogDispatcher) Debug

func (ld *LogDispatcher) Debug(message string)

func (*LogDispatcher) Error

func (ld *LogDispatcher) Error(message string)

func (*LogDispatcher) Info

func (ld *LogDispatcher) Info(message string)

func (*LogDispatcher) RegisterExporter

func (ld *LogDispatcher) RegisterExporter(e Exporter)

RegisterExporter adds a new destination (e.g., SIEM, RPC) to the dispatcher.

type LogItem

type LogItem struct {
	Timestamp int64  `json:"timestamp"`
	Level     string `json:"level"`
	Message   string `json:"message"`
	Service   string `json:"service"`
	Actor     string `json:"actor,omitempty"`
	Action    string `json:"action,omitempty"`
}

LogItem represents a structured log entry.

Jump to

Keyboard shortcuts

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