Help us shape the future of Go! Take the 2026 Go Developer Survey

logging

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Oct 7, 2014 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Debug

func Debug(fm string, v ...interface{})

func Error

func Error(fm string, v ...interface{})

func Fatal

func Fatal(fm string, v ...interface{})

func Info

func Info(fm string, v ...interface{})

func Log

func Log(lv LogLevel, fm string, v ...interface{})

func LogString

func LogString(lv LogLevel) string

func New

func New(m LogMap, lv LogLevel, only bool) *logger

You'll have to set up your own loggers for this one...

func SetLogLevel

func SetLogLevel(lv LogLevel)

func SetOnly

func SetOnly(only bool)

func Warn

func Warn(fm string, v ...interface{})

Types

type LogLevel

type LogLevel int
const (
	LogFatal LogLevel = iota - 1
	LogError
	LogWarn
	LogInfo
	LogDebug
)

type LogMap

type LogMap map[LogLevel]*log.Logger

type Logger

type Logger interface {
	// Log at a given level
	Log(LogLevel, string, ...interface{})
	// Log at level 3
	Debug(string, ...interface{})
	// Log at level 2
	Info(string, ...interface{})
	// Log at level 1
	Warn(string, ...interface{})
	// Log at level 0
	Error(string, ...interface{})
	// Log at level -1, to STDERR always, and exit after logging.
	Fatal(string, ...interface{})
	// Change the current log display level
	SetLogLevel(LogLevel)
	// Set the logger to only output the current level
	SetOnly(bool)
}

func InitFromFlags

func InitFromFlags() Logger

type MockLogger

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

Mock of Logger interface

func NewMockLogger

func NewMockLogger(ctrl *gomock.Controller) *MockLogger

func (*MockLogger) Debug

func (_m *MockLogger) Debug(_param0 string, _param1 ...interface{})

func (*MockLogger) EXPECT

func (_m *MockLogger) EXPECT() *_MockLoggerRecorder

func (*MockLogger) Error

func (_m *MockLogger) Error(_param0 string, _param1 ...interface{})

func (*MockLogger) Fatal

func (_m *MockLogger) Fatal(_param0 string, _param1 ...interface{})

func (*MockLogger) Info

func (_m *MockLogger) Info(_param0 string, _param1 ...interface{})

func (*MockLogger) Log

func (_m *MockLogger) Log(_param0 LogLevel, _param1 string, _param2 ...interface{})

func (*MockLogger) SetLogLevel

func (_m *MockLogger) SetLogLevel(_param0 LogLevel)

func (*MockLogger) SetOnly

func (_m *MockLogger) SetOnly(_param0 bool)

func (*MockLogger) Warn

func (_m *MockLogger) Warn(_param0 string, _param1 ...interface{})

Jump to

Keyboard shortcuts

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