fxeventlog

package
v0.0.0-...-5d01d84 Latest Latest
Warning

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

Go to latest
Published: Oct 17, 2025 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package fxeventlog provides a minimal, cleaner Fx event logger backed by zap.

It reduces noise during application boot while preserving important events and errors. Intended for use with fx.WithLogger in services.

Index

Constants

This section is empty.

Variables

View Source
var DefaultOptions = Options{
	ShowProvide:   false,
	ShowDecorate:  false,
	ShowInvoke:    false,
	ShowLifecycle: false,
	ShowSupplied:  false,
	Summaries:     true,
}

DefaultOptions keeps boot logs tidy but informative.

Functions

This section is empty.

Types

type MinimalZap

type MinimalZap struct {
	L   *zap.Logger
	Lvl zapcore.Level // default info

	O Options
	// contains filtered or unexported fields
}

MinimalZap is a minimalistic fxevent.Logger. It logs important lifecycle events and errors, and keeps boot output tidy.

func NewMinimal

func NewMinimal(l *zap.Logger) *MinimalZap

NewMinimal constructs a MinimalZap with sensible defaults.

func NewWithOptions

func NewWithOptions(l *zap.Logger, o Options) *MinimalZap

NewWithOptions constructs a MinimalZap with the supplied options.

func (*MinimalZap) LogEvent

func (m *MinimalZap) LogEvent(e fxevent.Event)

LogEvent implements fxevent.Logger.

type Options

type Options struct {
	// Show per-constructor provide events. Errors are always logged.
	ShowProvide bool
	// Show per-decorator events. Errors are always logged.
	ShowDecorate bool
	// Show per-invoke events. Errors are always logged.
	ShowInvoke bool
	// Show lifecycle hook execution logs (OnStart/OnStop). Errors are always logged.
	ShowLifecycle bool
	// Show supplied values; usually noisy. Errors are always logged.
	ShowSupplied bool
	// Emit a compact startup/shutdown summary with counters and durations.
	Summaries bool
}

Options controls verbosity and summaries for MinimalZap.

Jump to

Keyboard shortcuts

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