logger

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Dec 21, 2017 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// Writer is a log writer which logger.Info() or logger.Debug()
	// writes to.
	Writer logwriter.Writer = logwriter.New(os.Stdout)
)

Functions

func Debug

func Debug(queue string, action string, j LoggableJob, msg string)

Debug writes a DEBUG level log entry of a job action.

func Elapsed

func Elapsed(j LoggableJob) int64

Elapsed returns elapsed since the job is created in millisecond.

func Info

func Info(queue string, action string, j LoggableJob, msg string)

Info writes an INFO level log entry of a job action.

func Init

func Init()

Init initializes global parameters of logger by configuration values.

Configuration keys prefixed by "queue_log_" are considered.

Types

type LoggableJob

type LoggableJob interface {
	Category() string
	URL() string
	Payload() string

	ID() uint64
	Status() string

	NextTry() uint64
	RetryCount() uint
	RetryDelay() uint
	FailCount() uint
	Timeout() uint

	CreatedAt() uint64
}

LoggableJob defines fields of a job to be written into the log.

Jump to

Keyboard shortcuts

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