compat

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Feb 5, 2026 License: AGPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	LogLevel_Trace = core.LevelTrace
	LogLevel_Debug = core.LevelDebug
	LogLevel_Info  = core.LevelInfo
	LogLevel_Warn  = core.LevelWarn
	LogLevel_Error = core.LevelError
	LogLevel_Fatal = core.LevelFatal
)

Backward compatible log level constants

Variables

This section is empty.

Functions

This section is empty.

Types

type CompatLogger

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

CompatLogger provides backward compatibility with the old logger API

func GetLogger

func GetLogger(serviceName string) *CompatLogger

GetLogger returns a logger instance for the given service name. This function provides backward compatibility with the old API. For new code, prefer using New() directly.

func NewCompatLogger

func NewCompatLogger(coreLogger *core.Logger) *CompatLogger

NewCompatLogger creates a new CompatLogger with the given logger This is primarily for testing purposes

func (*CompatLogger) ClearParameters

func (c *CompatLogger) ClearParameters()

ClearParameters clears all persistent parameters

func (*CompatLogger) Log

func (c *CompatLogger) Log(level core.LogLevel, eventType string, eventData map[string]any, traceData map[string]any)

Log logs a message with the given level, event type, event data, and trace data. This function provides backward compatibility with the old API.

Parameters:

  • level: LogLevel (use LogLevel_Debug, LogLevel_Info, etc.)
  • eventType: string describing the event type
  • eventData: map containing event-specific data (message should be in eventData["message"])
  • traceData: map containing trace information (id should be in traceData["id"])

func (*CompatLogger) SetLevel

func (c *CompatLogger) SetLevel(level core.LogLevel)

SetLevel sets the log level for this logger

func (*CompatLogger) SetOutput

func (c *CompatLogger) SetOutput(output *os.File)

SetOutput sets the output writer for this logger

func (*CompatLogger) SetParameters

func (c *CompatLogger) SetParameters(params map[string]any)

SetParameters sets persistent parameters that will be included in all subsequent log entries

func (*CompatLogger) SetPrettyPrint

func (c *CompatLogger) SetPrettyPrint(enabled bool)

SetPrettyPrint enables or disables pretty printing

Source Files

  • compat.go

Jump to

Keyboard shortcuts

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