log

package module
v0.0.0-...-496a9e3 Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2013 License: MIT Imports: 4 Imported by: 70

README

log is a little wrapper on top of the original log package to provide the log level feature, eg:

log.Info("Hello world")
log.Errorf("Download failed because: %s", err)
log.Warning("Something went wrong")
log.Fatal(err)

In addition, the log.Fatal function exits after printing the stack trace of the current goroutine.

Finally, level prefixes are formatted as <LEVEL> -- <msg> - solely to match the default format of vcap_logging. Ideally it should be made configurable using the text/template package.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Error

func Error(v ...interface{})

func Errorf

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

func Fatal

func Fatal(v ...interface{})

func Fatal0

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

func Fatalf

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

func Info

func Info(v ...interface{})

func Infof

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

func Warn

func Warn(v ...interface{})

func Warnf

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

Types

type Logger

type Logger struct {
	*log.Logger
}

func New

func New() *Logger

func (*Logger) Error

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

func (*Logger) Errorf

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

func (*Logger) Fatal

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

Fatal behaves mostly like log.Fatal but it also prints the current goroutine's stacktrace.

func (*Logger) Fatal0

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

Fatal0 is like Fatalf, but does not exit (useful to performing cleanup routines after displaying the fatal message)

func (*Logger) Fatalf

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

func (*Logger) Info

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

func (*Logger) Infof

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

func (*Logger) Warn

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

func (*Logger) Warnf

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

Jump to

Keyboard shortcuts

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