logfx

package
v1.12.2 Latest Latest
Warning

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

Go to latest
Published: Jan 29, 2026 License: GPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Module = fx.Module("logfx",
	fx.Provide(
		NewLogger,

		fx.Annotate(
			NewLevelReloader,
			fx.As(new(reloadfx.Reloadable)),
			fx.ResultTags(`group:"reloaders"`),
		),
	),
	fx.Invoke(BridgeStdLog),
)

Module defines the logfx module for UberFX.

Functions

func BridgeStdLog

func BridgeStdLog(lc fx.Lifecycle, logger *slog.Logger)

BridgeStdLog wires the standard library log package to the provided slog logger.

This is executed in an fx lifecycle hook to ensure the logger is available.

func NewFxEventLogger

func NewFxEventLogger(logger *slog.Logger) fxevent.Logger

func NewLogger

func NewLogger() *slog.Logger

NewLogger provides the process logger.

func WithFxEventLogger

func WithFxEventLogger(logger *slog.Logger) fx.Option

Types

type FxEventLogger

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

FxEventLogger adapts fx internal events to the existing slog-based logging.

func (*FxEventLogger) LogEvent

func (l *FxEventLogger) LogEvent(event fxevent.Event)

type LevelReloader

type LevelReloader struct{}

LevelReloader handles atomic updates of the level package configuration.

func NewLevelReloader

func NewLevelReloader() *LevelReloader

NewLevelReloader creates a new LevelReloader instance.

func (*LevelReloader) ApplyConfig

func (l *LevelReloader) ApplyConfig(ctx context.Context, snap configfx.Snapshot) error

ApplyConfig syncs the new configuration to the level package.

func (*LevelReloader) Name

func (l *LevelReloader) Name() string

Name returns the name of the reloader for the reload manager.

func (*LevelReloader) Order

func (l *LevelReloader) Order() int

Order defines the execution order during a reload.

Jump to

Keyboard shortcuts

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