pegalog

package
v0.0.0-...-ba0e684 Latest Latest
Warning

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

Go to latest
Published: May 19, 2022 License: Apache-2.0 Imports: 8 Imported by: 17

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultLogrusLogger = NewLogrusLogger(&LogrusConfig{
	MaxSize:  500,
	MaxAge:   5,
	Filename: "./pegasus.log",
})

DefaultLogrusLogger is a LogrusLogger instance with default configurations.

View Source
var StderrLogger = log.New(os.Stderr, "", log.LstdFlags)

StderrLogger is an implementation of Logger that outputs logs to stderr. WARN: Don't use it in your production environment. Lack of logs after failures will make it

significantly difficult to track the root cause.

Functions

func SetLogger

func SetLogger(l Logger)

SetLogger sets client-side Logger. By default, logs are disabled.

Types

type Logger

type Logger interface {
	Fatal(args ...interface{})
	Fatalf(format string, args ...interface{})
	Print(args ...interface{})
	Printf(format string, args ...interface{})
}

Logger is the internal logger served for pegasus go client. WARN: Don't use this logger for your application.

func GetLogger

func GetLogger() Logger

GetLogger returns the current logger.

func NewLogrusLogger

func NewLogrusLogger(cfg *LogrusConfig) Logger

NewLogrusLogger creates a new LogrusLogger.

type LogrusConfig

type LogrusConfig struct {
	Filename   string
	MaxSize    int
	MaxAge     int
	MaxBackups int
}

LogrusConfig is used to configure the generation of log files.

Jump to

Keyboard shortcuts

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