logger

package
v1.9.0 Latest Latest
Warning

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

Go to latest
Published: Jan 6, 2022 License: BSD-3-Clause Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Debugf

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

Debugf log to level debug

func Errorf

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

Errorf log to level error

func FatalIfError

func FatalIfError(err error)

FatalIfError if err is not nil, then log to level fatal and call os.Exit

func FatalfIf

func FatalfIf(cond bool, fmt string, args ...interface{})

FatalfIf log to level error

func Infof

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

Infof log to level info

func InitLog

func InitLog(level string)

InitLog is an initialization for a logger level can be: debug info warn error

func Warnf

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

Warnf log to level warn

func WithLogger added in v1.9.0

func WithLogger(log Logger)

Types

type Logger added in v1.9.0

type Logger interface {
	Debugf(format string, args ...interface{})
	Infof(format string, args ...interface{})
	Warnf(format string, args ...interface{})
	Errorf(format string, args ...interface{})
}

Logger logger interface

Jump to

Keyboard shortcuts

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