log

package
v0.20.0 Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2020 License: GPL-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var StdLogger = New(false)

StdLogger is the logger that is used from the log functions in this package

Functions

func DebugEnabled

func DebugEnabled() bool

DebugEnabled returns true if the Stdlogger logs debug messages

func Debugf

func Debugf(format string, v ...interface{})

Debugf logs a debug message to stdout. It's only shown if debugging is enabled.

func Debugln

func Debugln(v ...interface{})

Debugln logs a debug message to stdout. It's only shown if debugging is enabled.

func Errorf

func Errorf(format string, v ...interface{})

Errorf logs a message to stderr

func Errorln

func Errorln(v ...interface{})

Errorln logs a message to stderr

func Fatalf

func Fatalf(format string, v ...interface{})

Fatalf logs a message to stderr and terminates the application with an error

func Fatalln

func Fatalln(v ...interface{})

Fatalln logs a message to stderr and terminates the application with an error

func Warnf added in v0.16.0

func Warnf(format string, v ...interface{})

Warnf logs a message to stderr

Types

type Logger added in v0.11.1

type Logger struct {
	// contains filtered or unexported fields
}

Logger logs messages

func New added in v0.11.1

func New(debugEnabled bool) *Logger

New returns a new Logger that logs to Stderr. Debug messages are only printed if debugEnabled is true

func (*Logger) DebugEnabled added in v0.11.1

func (l *Logger) DebugEnabled() bool

DebugEnabled returns true if logging debug messages is enabled

func (*Logger) Debugf added in v0.11.1

func (l *Logger) Debugf(format string, v ...interface{})

Debugf logs a debug message to stdout. It's only shown if debugging is enabled.

func (*Logger) Debugln added in v0.11.1

func (l *Logger) Debugln(v ...interface{})

Debugln logs a debug message to stdout. It's only shown if debugging is enabled.

func (*Logger) EnableDebug added in v0.11.1

func (l *Logger) EnableDebug(enabled bool)

EnableDebug enables/disables logging debug messages

func (*Logger) Errorf added in v0.11.1

func (l *Logger) Errorf(format string, v ...interface{})

Errorf logs a message to stderr

func (*Logger) Errorln added in v0.11.1

func (l *Logger) Errorln(v ...interface{})

Errorln logs a message to stderr

func (*Logger) Fatalf added in v0.11.1

func (l *Logger) Fatalf(format string, v ...interface{})

Fatalf logs a message to stderr and terminates the application with an error

func (*Logger) Fatalln added in v0.11.1

func (l *Logger) Fatalln(v ...interface{})

Fatalln logs a message to stderr and terminates the application with an error

func (*Logger) Warnf added in v0.16.0

func (l *Logger) Warnf(format string, v ...interface{})

Warnf logs a message to stderr

Jump to

Keyboard shortcuts

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