envoylog

package module
v0.0.0-...-fafe139 Latest Latest
Warning

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

Go to latest
Published: Apr 8, 2025 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Overview

Package envoylog provides the envoylog handler.

Index

Constants

View Source
const Name = "envoylog"

Name is this providers name.

Variables

This section is empty.

Functions

func Factory

func Factory(sections []string, configs map[string]any, opts ...log.Option) (log.ProviderType, error)

Factory is the factory for a slog provider.

Types

type Config

type Config struct {
	log.Config
}

Config is the config struct for slog.

func NewConfig

func NewConfig(opts ...log.Option) Config

NewConfig creates a new config.

type Handler

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

func (*Handler) Enabled

func (h *Handler) Enabled(_ context.Context, level slog.Level) bool

func (*Handler) Handle

func (h *Handler) Handle(_ context.Context, r slog.Record) error

func (*Handler) WithAttrs

func (h *Handler) WithAttrs(attrs []slog.Attr) slog.Handler

WithAttrs returns a new [TextHandler] whose attributes consists of h's attributes followed by attrs.

func (*Handler) WithGroup

func (h *Handler) WithGroup(name string) slog.Handler

type Provider

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

Provider is the provider for slog.

func (*Provider) Handler

func (p *Provider) Handler() (slog.Handler, error)

Handler returns the configure handler.

func (*Provider) Key

func (p *Provider) Key() string

Key returns an identifier for this handler provider with its config.

func (*Provider) Start

func (p *Provider) Start() error

Start configures the slog Handler.

func (*Provider) Stop

func (p *Provider) Stop(_ context.Context) error

Stop closes if required a open log file.

Directories

Path Synopsis
Package buffer provides a pool-allocated byte buffer.
Package buffer provides a pool-allocated byte buffer.

Jump to

Keyboard shortcuts

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