logopts

package
v0.16.2 Latest Latest
Warning

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

Go to latest
Published: Oct 18, 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

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

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

func (*ConfigFragment) Evaluate

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

func (*ConfigFragment) GetLogConfig

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

type EvaluatedOptions

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

func (*EvaluatedOptions) Close

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