logopts

package
v0.13.0 Latest Latest
Warning

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

Go to latest
Published: Aug 5, 2024 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Overview

Package logopts is used for CLI options used to control the logging, globally or for a dedicated context. If used the main program should call logopts.CloseLogFiles() before exiting.

Index

Constants

This section is empty.

Variables

View Source
var Description = `` /* 1379-byte string literal not displayed */

Functions

This section is empty.

Types

type ConfigFragment added in v0.12.0

type ConfigFragment struct {
	LogLevel  string   `json:"logLevel,omitempty"`
	LogConfig string   `json:"logConfig,omitempty"`
	LogKeys   []string `json:"logKeys,omitempty"`
	Json      bool     `json:"json,omitempty"`

	// LogFileName is a CLI option, only. Do not serialize and forward
	LogFileName string `json:"-"`
}

ConfigFragment is a serializable log config used for CLI commands.

func (*ConfigFragment) AddFlags added in v0.12.0

func (c *ConfigFragment) AddFlags(fs *pflag.FlagSet)

func (*ConfigFragment) Evaluate added in v0.12.0

func (c *ConfigFragment) Evaluate(ctx ocm.Context, logctx logging.Context, main bool) (*EvaluatedOptions, error)

func (*ConfigFragment) GetLogConfig added in v0.12.0

func (c *ConfigFragment) GetLogConfig(fss ...vfs.FileSystem) (*config.Config, error)

type EvaluatedOptions added in v0.12.0

type EvaluatedOptions struct {
	LogForward *config.Config
	LogFile    *logging2.LogFile
}

func (*EvaluatedOptions) Close added in v0.12.0

func (o *EvaluatedOptions) Close() error

type Options

type Options struct {
	ConfigFragment
	*EvaluatedOptions
}

func (*Options) AddFlags

func (o *Options) AddFlags(fs *pflag.FlagSet)

func (*Options) Close

func (o *Options) Close() error

func (*Options) Configure

func (o *Options) Configure(ctx ocm.Context, logctx logging.Context) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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