logging

package
v3.9.3 Latest Latest
Warning

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

Go to latest
Published: Dec 26, 2022 License: Apache-2.0 Imports: 7 Imported by: 1

Documentation

Overview

Package logging is the package that contains logging library.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Debugf

func Debugf(format string, a ...interface{})

Debugf prints logging if logging level >= debug

func Errorf

func Errorf(format string, a ...interface{}) error

Errorf prints logging if logging level >= error

func Panicf

func Panicf(format string, a ...interface{})

Panicf prints logging plus stack trace. This should be used only for unrecoverable error

func SetLogFile

func SetLogFile(filename string)

SetLogFile sets logging file

func SetLogLevel

func SetLogLevel(levelStr string)

SetLogLevel sets logging level

func SetLogOptions added in v3.9.1

func SetLogOptions(options *LogOptions)

SetLogOptions set the LoggingOptions of NetConf

func SetLogStderr

func SetLogStderr(enable bool)

SetLogStderr sets flag for logging stderr output

func Verbosef

func Verbosef(format string, a ...interface{})

Verbosef prints logging if logging level >= verbose

Types

type Level

type Level uint32

Level type

const (
	PanicLevel Level = iota
	ErrorLevel
	VerboseLevel
	DebugLevel
	MaxLevel
	UnknownLevel
)

PanicLevel...MaxLevel indicates the logging level

func GetLoggingLevel

func GetLoggingLevel() Level

GetLoggingLevel gets current logging level

func (Level) String

func (l Level) String() string

type LogOptions added in v3.9.1

type LogOptions struct {
	MaxAge     *int  `json:"maxAge,omitempty"`
	MaxSize    *int  `json:"maxSize,omitempty"`
	MaxBackups *int  `json:"maxBackups,omitempty"`
	Compress   *bool `json:"compress,omitempty"`
}

LogOptions specifies the configuration of the log

Jump to

Keyboard shortcuts

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