log

package
v0.0.1-RC9 Latest Latest
Warning

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

Go to latest
Published: Jan 19, 2023 License: GPL-3.0 Imports: 6 Imported by: 25

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Debug

func Debug(args ...interface{})

Debug calls log.Debug

func Debugf

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

Debugf calls log.Debugf

func Debugw

func Debugw(template string, kv ...interface{})

Debugw calls log.Debugw

func Error

func Error(args ...interface{})

Error calls log.Error

func Errorf

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

Errorf calls log.Errorf and stores the error message into the ErrorFile

func Errorw

func Errorw(template string, kv ...interface{})

Errorw calls log.Errorw

func Fatal

func Fatal(args ...interface{})

Fatal calls log.Fatal

func Fatalf

func Fatalf(template string, args ...interface{})

Fatalf calls log.Fatalf

func Fatalw

func Fatalw(template string, kv ...interface{})

Fatalw calls log.Fatalw

func Info

func Info(args ...interface{})

Info calls log.Info

func Infof

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

Infof calls log.Infof

func Infow

func Infow(template string, kv ...interface{})

Infow calls log.Infow

func Init

func Init(cfg Config)

Init the logger with defined level. outputs defines the outputs where the logs will be sent. By default outputs contains "stdout", which prints the logs at the output of the process. To add a log file as output, the path should be added at the outputs array. To avoid printing the logs but storing them on a file, can use []string{"pathtofile.log"}

func NewLogger

func NewLogger(cfg Config) (*zap.SugaredLogger, *zap.AtomicLevel, error)

NewLogger creates the logger with defined level. outputs defines the outputs where the logs will be sent. By default, outputs contains "stdout", which prints the logs at the output of the process. To add a log file as output, the path should be added at the outputs array. To avoid printing the logs but storing them on a file, can use []string{"pathtofile.log"}

func Warn

func Warn(args ...interface{})

Warn calls log.Warn

func Warnf

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

Warnf calls log.Warnf

func Warnw

func Warnw(template string, kv ...interface{})

Warnw calls log.Warnw

Types

type Config

type Config struct {
	// Level of log, e.g. INFO, WARN, ...
	Level string `mapstructure:"Level"`
	// Outputs
	Outputs []string `mapstructure:"Outputs"`
}

Config for log

Jump to

Keyboard shortcuts

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