log

package
v0.3.2 Latest Latest
Warning

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

Go to latest
Published: Sep 5, 2026 License: Apache-2.0 Imports: 10 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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