logger

package
v0.0.0-...-0296ce8 Latest Latest
Warning

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

Go to latest
Published: Oct 25, 2021 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Configure

func Configure(options *Options) error

Must be called once at process startup.

func Debug

func Debug(args ...interface{})

Debug is debug level

func Debugf

func Debugf(fmt string, args ...interface{})

Debugf is format debug level

func Error

func Error(args ...interface{})

Error is error level

func Errorf

func Errorf(fmt string, args ...interface{})

Errorf is format error level

func GetLogger

func GetLogger() *zap.SugaredLogger

func Info

func Info(args ...interface{})

Info is info level

func Infof

func Infof(fmt string, args ...interface{})

Infof is format info level

func Sync

func Sync()

func Warn

func Warn(args ...interface{})

Warn is warning level

func Warnf

func Warnf(fmt string, args ...interface{})

Warnf is format warning level

Types

type Options

type Options struct {
	OutputLevel string

	OutputPaths []string

	RotateOutputPath string

	RotationMaxSize int

	RotationMaxAge int

	RotationMaxBackups int

	// localTime determines whether the time format of log is local time format.
	// Default is true
	LocalTime bool
}

func DefaultOptions

func DefaultOptions() *Options

func (*Options) AttachCobraFlags

func (o *Options) AttachCobraFlags(cmd *cobra.Command)

func (*Options) AttachFlags

func (o *Options) AttachFlags(
	stringArrayVar func(p *[]string, name string, value []string, usage string),
	stringVar func(p *string, name string, value string, usage string),
	intVar func(p *int, name string, value int, usage string),
	boolVar func(p *bool, name string, value bool, usage string))

func (*Options) GetOutputLevel

func (o *Options) GetOutputLevel() zapcore.Level

Jump to

Keyboard shortcuts

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