log

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Oct 10, 2013 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const AsyncBuffer = 100

Variables

View Source
var BasicFields = []string{"time", "priority", "prefix", "message"}
View Source
var BasicFormat = "%s [%9s] %s- %s\n"
View Source
var RichFields = []string{"full_time", "priority", "seq", "prefix", "filename", "funcname", "lineno", "message"}
View Source
var RichFormat = "%s [%9s] %d %s - %s:%s:%d - %s\n"

Functions

func Alert

func Alert(v ...interface{})

func Alertf

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

func Critical

func Critical(v ...interface{})

func Criticalf

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

func Debug

func Debug(v ...interface{})

func Debugf

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

func Emergency

func Emergency(v ...interface{})

func Emergencyf

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

func Error

func Error(v ...interface{})

func Errorf

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

func Fatalf

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

func Fatalln

func Fatalln(v ...interface{})

func Info

func Info(v ...interface{})

func Infof

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

func Notice

func Notice(v ...interface{})

func Noticef

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

func Panicf

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

func Panicln

func Panicln(v ...interface{})

func Printf

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

func Println

func Println(v ...interface{})

func Warning

func Warning(v ...interface{})

func Warningf

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

Types

type Fields

type Fields map[string]interface{}

type Logger

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

Logger is user-immutable immutable struct which can log to several outputs

func New

func New(prefix string, verbose bool, sinks ...Sink) *Logger

New creates a new Logger which logs to all the supplied sinks. The prefix argument is passed to all loggers under the field "prefix" with every log message. If verbose is true, more expensive runtime fields will be computed and passed to loggers. These fields are funcname, lineno, pathname, and filename.

func NewSimple

func NewSimple(sinks ...Sink) *Logger

NewSimple(sinks...) is equivalent to New("", false, sinks...)

func (*Logger) Alert

func (logger *Logger) Alert(v ...interface{})

func (*Logger) Alertf

func (logger *Logger) Alertf(format string, v ...interface{})

func (*Logger) Critical

func (logger *Logger) Critical(v ...interface{})

func (*Logger) Criticalf

func (logger *Logger) Criticalf(format string, v ...interface{})

func (*Logger) Debug

func (logger *Logger) Debug(v ...interface{})

func (*Logger) Debugf

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

func (*Logger) Emergency

func (logger *Logger) Emergency(v ...interface{})

func (*Logger) Emergencyf

func (logger *Logger) Emergencyf(format string, v ...interface{})

func (*Logger) Error

func (logger *Logger) Error(v ...interface{})

func (*Logger) Errorf

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

func (*Logger) Fatalf

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

func (*Logger) Fatalln

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

func (*Logger) Info

func (logger *Logger) Info(v ...interface{})

func (*Logger) Infof

func (logger *Logger) Infof(format string, v ...interface{})

func (*Logger) Log

func (logger *Logger) Log(priority Priority, v ...interface{})

This function has an unusual name to aid in finding it while walking the stack. We need to do some dead reckoning from this function to access the caller's stack, so there is a consistent call depth above this function.

func (*Logger) Logf

func (logger *Logger) Logf(priority Priority, format string, v ...interface{})

func (*Logger) Notice

func (logger *Logger) Notice(v ...interface{})

func (*Logger) Noticef

func (logger *Logger) Noticef(format string, v ...interface{})

func (*Logger) Panicf

func (logger *Logger) Panicf(format string, v ...interface{})

func (*Logger) Panicln

func (logger *Logger) Panicln(v ...interface{})

func (*Logger) Printf

func (logger *Logger) Printf(format string, v ...interface{})

func (*Logger) Println

func (logger *Logger) Println(v ...interface{})

func (*Logger) Warning

func (logger *Logger) Warning(v ...interface{})

func (*Logger) Warningf

func (logger *Logger) Warningf(format string, v ...interface{})

type Priority

type Priority int
const (
	PriEmerg Priority = iota
	PriAlert
	PriCrit
	PriErr
	PriWarning
	PriNotice
	PriInfo
	PriDebug
)

func (Priority) String

func (priority Priority) String() string

type Sink

type Sink interface {
	Log(Fields)
}

func CombinedSink

func CombinedSink(writer io.Writer, format string, fields []string) Sink

func JournalSink

func JournalSink() Sink

func NullSink

func NullSink() Sink

func PriorityFilter

func PriorityFilter(priority Priority, target Sink) Sink

func WriterSink

func WriterSink(out io.Writer, format string, fields []string) Sink

Jump to

Keyboard shortcuts

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