zerolog

package
v0.12.2 Latest Latest
Warning

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

Go to latest
Published: Mar 13, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ZeroLogBackend

type ZeroLogBackend struct {
	log.CommonBackend
	// contains filtered or unexported fields
}

ZeroLogBackend writes log entries as structured JSON using rs/zerolog. It respects the CommonBackend gate and emits the following fields: - time (from Entry.Time) - sender - severity - severity_index - message (standard zerolog message field)

func New

func New(writer io.Writer) *ZeroLogBackend

New creates a new ZeroLogBackend. If writer is nil, os.Stderr is used.

func (*ZeroLogBackend) NotifyAboutSender

func (z *ZeroLogBackend) NotifyAboutSender(sender string)

NotifyAboutSender is a no-op for structured logs but required by the interface.

func (*ZeroLogBackend) NotifyAboutSeverity

func (z *ZeroLogBackend) NotifyAboutSeverity(severity *log.Severity)

NotifyAboutSeverity is a no-op for structured logs but required by the interface.

func (*ZeroLogBackend) Shutdown

func (z *ZeroLogBackend) Shutdown()

Shutdown implements Backend but no cleanup is necessary.

func (*ZeroLogBackend) Write

func (z *ZeroLogBackend) Write(entry log.Entry) error

Write emits the entry to the configured writer using zerolog.

Source Files

  • Backend.go

Jump to

Keyboard shortcuts

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