log

package
v1.1.1 Latest Latest
Warning

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

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

Documentation

Overview

Package log providers a simple logging implementation.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Logger

type Logger struct {
	Debug state
	Info  state
	Warn  state
	Error state
	// contains filtered or unexported fields
}

Logger is the type for logging information at different levels of severity. The Logger has three states representing each level that can be logged at, Debug, Info, and Error.

func New

func New(wc io.WriteCloser) *Logger

New returns a new Logger that will write to the given io.Writer. This will use the stdlib's logger with the log.Ldate, log.Ltime, and log.LUTC flags set. The default level of the returned Logger is info.

func (*Logger) Close

func (l *Logger) Close() error

func (*Logger) SetLevel

func (l *Logger) SetLevel(s string)

SetLevel sets the level of the logger. The level should be either "debug", "info", or "error". If the given string is none of these values then the logger's level will be unchanged.

func (*Logger) SetWriter

func (l *Logger) SetWriter(w io.WriteCloser)

SetWriter set's the io.Writer for the underlying logger.

type Queue added in v1.1.0

type Queue struct {
	*Logger
}

Queue is a logger that can be given to CurlyQ for logging information about the jobs being processed.

func (Queue) Debug added in v1.1.0

func (q Queue) Debug(v ...interface{})

func (Queue) Error added in v1.1.0

func (q Queue) Error(v ...interface{})

func (Queue) Info added in v1.1.0

func (q Queue) Info(v ...interface{})

func (Queue) Warn added in v1.1.0

func (q Queue) Warn(v ...interface{})

Jump to

Keyboard shortcuts

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