Thanks to visit codestin.com
Credit goes to pkg.go.dev

clilog

package
v2.21.3 Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2025 License: AGPL-3.0 Imports: 15 Imported by: 0

Documentation

Overview

Package clilog provides a fluent API for configuring structured logging.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Builder

type Builder struct {
	Filter      []string
	Human       string
	JSON        string
	Stackdriver string
	Trace       bool
	Verbose     bool
}

func New

func New(opts ...Option) *Builder

func (*Builder) Build

func (b *Builder) Build(inv *serpent.Invocation) (log slog.Logger, closeLog func(), err error)

type LumberjackWriteCloseFixer added in v2.18.0

type LumberjackWriteCloseFixer struct {
	Writer io.WriteCloser
	// contains filtered or unexported fields
}

LumberjackWriteCloseFixer is a wrapper around an io.WriteCloser that prevents writes after Close. This is necessary because lumberjack re-opens the file on Write.

func (*LumberjackWriteCloseFixer) Close added in v2.18.0

func (c *LumberjackWriteCloseFixer) Close() error

func (*LumberjackWriteCloseFixer) Write added in v2.18.0

func (c *LumberjackWriteCloseFixer) Write(p []byte) (int, error)

type Option

type Option func(*Builder)

func FromDeploymentValues

func FromDeploymentValues(vals *codersdk.DeploymentValues) Option

func WithFilter

func WithFilter(filters ...string) Option

func WithHuman

func WithHuman(loc string) Option

func WithJSON

func WithJSON(loc string) Option

func WithStackdriver

func WithStackdriver(loc string) Option

func WithTrace

func WithTrace() Option

func WithVerbose

func WithVerbose() Option

Jump to

Keyboard shortcuts

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