log

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2026 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	LevelDebug = "debug"
	LevelInfo  = "info"
	LevelWarn  = "warn"
	LevelError = "error"
)

Variables

Functions

This section is empty.

Types

type Options

type Options struct {
	LogLevel string
	// contains filtered or unexported fields
}

Options provides logging configuration for Carabiner applications.

func (*Options) AddFlags

func (lo *Options) AddFlags(cmd *cobra.Command)

AddFlags adds the logging flags to a command.

func (*Options) Config

func (lo *Options) Config() *command.OptionsSetConfig

Config returns the flag configuration for logging options.

func (*Options) InitLogger

func (lo *Options) InitLogger() (*clog.Logger, error)

InitLogger creates and configures a structured logger with the specified level. The logger uses GCP-compatible field names for cloud deployment.

func (*Options) Validate

func (lo *Options) Validate() error

Validate checks that the log level is valid.

func (*Options) WithLogger

func (lo *Options) WithLogger(ctx context.Context) (context.Context, error)

WithLogger initializes the logger and returns a context with the logger configured. This is a convenience method that combines InitLogger() and clog.WithLogger().

Jump to

Keyboard shortcuts

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