log

package
v0.5.0-rc3 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	IsDebug bool = false
)

Functions

func Debug

func Debug(args ...interface{})

func Debugf

func Debugf(fmtString string, args ...interface{})

func Error

func Error(args ...interface{})

func Errorf

func Errorf(fmtString string, args ...interface{})

func Errorln

func Errorln(args ...interface{})

func Fatal

func Fatal(args ...interface{})

func Fatalf

func Fatalf(fmtString string, args ...interface{})

func Info

func Info(args ...interface{})

func Infof

func Infof(fmtString string, args ...interface{})

func Infoln

func Infoln(args ...interface{})

func Print

func Print(args ...interface{})

func Printf

func Printf(fmtString string, args ...interface{})

func SetErrWriter

func SetErrWriter(w io.Writer)

func SetOutWriter

func SetOutWriter(w io.Writer)

func Warn

func Warn(args ...interface{})

func Warnf

func Warnf(fmtString string, args ...interface{})

Types

type Fields

type Fields map[string]interface{}

type Logger

type Logger interface {
	Debug(...interface{})
	Debugf(string, ...interface{})

	Error(...interface{})
	Errorf(string, ...interface{})

	Info(...interface{})
	Infof(string, ...interface{})

	Fatal(...interface{})
	Fatalf(string, ...interface{})

	Print(...interface{})
	Printf(string, ...interface{})

	Warn(...interface{})
	Warnf(string, ...interface{})

	WithFields(Fields) Logger
}

Why the interface? We may only want to print to STDOUT and STDERR for now, but it won't neccessarily be that way forever. This interface is intended to provide a "framework" for a variety of different logging types in the future (log to file, log to logstash, etc.) There could be a driver model similar to what is done with OS or machine providers.

func WithField

func WithField(fieldName string, field interface{}) Logger

func WithFields

func WithFields(fields Fields) Logger

type StandardLogger

type StandardLogger struct {
	OutWriter io.Writer
	ErrWriter io.Writer
	// contains filtered or unexported fields
}

func (StandardLogger) Debug

func (t StandardLogger) Debug(args ...interface{})

func (StandardLogger) Debugf

func (t StandardLogger) Debugf(fmtString string, args ...interface{})

func (StandardLogger) Error

func (t StandardLogger) Error(args ...interface{})

func (StandardLogger) Errorf

func (t StandardLogger) Errorf(fmtString string, args ...interface{})

func (StandardLogger) Errorln

func (t StandardLogger) Errorln(args ...interface{})

func (StandardLogger) Fatal

func (t StandardLogger) Fatal(args ...interface{})

func (StandardLogger) Fatalf

func (t StandardLogger) Fatalf(fmtString string, args ...interface{})

func (StandardLogger) Info

func (t StandardLogger) Info(args ...interface{})

func (StandardLogger) Infof

func (t StandardLogger) Infof(fmtString string, args ...interface{})

func (StandardLogger) Infoln

func (t StandardLogger) Infoln(args ...interface{})

func (StandardLogger) Print

func (t StandardLogger) Print(args ...interface{})

func (StandardLogger) Printf

func (t StandardLogger) Printf(fmtString string, args ...interface{})

func (StandardLogger) Warn

func (t StandardLogger) Warn(args ...interface{})

func (StandardLogger) Warnf

func (t StandardLogger) Warnf(fmtString string, args ...interface{})

func (StandardLogger) WithFields

func (t StandardLogger) WithFields(fields Fields) Logger

Jump to

Keyboard shortcuts

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