common

package
v0.0.0-...-f4b48e8 Latest Latest
Warning

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

Go to latest
Published: Jun 15, 2018 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SetLogger

func SetLogger(logger Logger)

Types

type ConsoleLogger

type ConsoleLogger struct {
	LogLevel LogLevel
}

func NewConsoleLogger

func NewConsoleLogger(logLevel LogLevel) *ConsoleLogger

func (ConsoleLogger) Debug

func (this ConsoleLogger) Debug(format string, args ...interface{})

func (ConsoleLogger) Error

func (this ConsoleLogger) Error(format string, args ...interface{})

func (ConsoleLogger) Info

func (this ConsoleLogger) Info(format string, args ...interface{})

func (ConsoleLogger) Notice

func (this ConsoleLogger) Notice(format string, args ...interface{})

func (ConsoleLogger) Trace

func (this ConsoleLogger) Trace(format string, args ...interface{})

func (ConsoleLogger) Warning

func (this ConsoleLogger) Warning(format string, args ...interface{})

type DummyLogger

type DummyLogger struct{}

Dummy Logger does nothing.

func (DummyLogger) Debug

func (this DummyLogger) Debug(format string, args ...interface{})

func (DummyLogger) Error

func (this DummyLogger) Error(format string, args ...interface{})

func (DummyLogger) Info

func (this DummyLogger) Info(format string, args ...interface{})

func (DummyLogger) Notice

func (this DummyLogger) Notice(format string, args ...interface{})

func (DummyLogger) Trace

func (this DummyLogger) Trace(format string, args ...interface{})

func (DummyLogger) Warning

func (this DummyLogger) Warning(format string, args ...interface{})

type LogLevel

type LogLevel int

Simple Console Logger that the tests use.

const (
	LogLevelTrace   LogLevel = 5
	LogLevelDebug   LogLevel = 4
	LogLevelInfo    LogLevel = 3
	LogLevelNotice  LogLevel = 2
	LogLevelWarning LogLevel = 1
	LogLevelError   LogLevel = 0
)

type Logger

type Logger interface {
	Error(format string, args ...interface{})
	Warning(format string, args ...interface{})
	Notice(format string, args ...interface{})
	Info(format string, args ...interface{})
	Debug(format string, args ...interface{})
	Trace(format string, args ...interface{})
}
var Log Logger = DummyLogger{}

Jump to

Keyboard shortcuts

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