Documentation
¶
Index ¶
Constants ¶
View Source
const ( DEFAULT = 2 VERBOSE = 3 DEBUG = 4 TRACE = 5 )
View Source
const (
ZapLogLevelFlagName = "zap-log-level"
)
Variables ¶
This section is empty.
Functions ¶
func InitLogging ¶
func InitSetupLogging ¶
func InitSetupLogging()
func NewTestLogger ¶
NewTestLogger creates a new Zap logger using the dev mode.
func NewTestLoggerIntoContext ¶
NewTestLoggerIntoContext creates a new Zap logger using the dev mode and inserts it into the given context.
Types ¶
type LoggingOptions ¶
type LoggingOptions struct {
LogVerbosity int // Number for the log level verbosity.
ZapOptions zap.Options // Zap logging options.
// contains filtered or unexported fields
}
LoggingOptions contains logging configuration for command-line flags.
func NewOptions ¶
func NewOptions() *LoggingOptions
NewOptions returns a new LoggingOptions struct initialized with default values.
func (*LoggingOptions) AddFlags ¶
func (opts *LoggingOptions) AddFlags(fs *pflag.FlagSet)
AddFlags binds the LoggingOptions fields to command-line flags on the given FlagSet.
func (*LoggingOptions) Complete ¶
func (opts *LoggingOptions) Complete() error
Complete performs post-processing of parsed command-line arguments. Derives the zap log level from the -v flag when --zap-log-level is not set explicitly.
func (*LoggingOptions) Validate ¶
func (opts *LoggingOptions) Validate() error
Validate checks the LoggingOptions for invalid values.
Click to show internal directories.
Click to hide internal directories.