log

package
v1.1.2 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2018 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Overview

Package log implements a small wrapper around the std lib log package. It implements log levels by prefixing the logs with [INFO], [DEBUG], [WARNING] or [ERROR]. Debug logging is available and enabled if the *debug* plugin is used.

log.Info("this is some logging"), will log on the Info level.

log.Debug("this is debug output"), will log in the Debug level.

Index

Constants

This section is empty.

Variables

D controls whether we should ouput debug logs. If true, we do.

Functions

func Debug

func Debug(v ...interface{})

Debug is equivalent to log.Print(), but prefixed with "[DEBUG] ". It only outputs something if D is true.

func Debugf

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

Debugf is equivalent to log.Printf(), but prefixed with "[DEBUG] ". It only outputs something if D is true.

func Error

func Error(v ...interface{})

Error is equivalent to log.Print, but prefixed with "[ERROR] ".

func Errorf

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

Errorf is equivalent to log.Printf, but prefixed with "[ERROR] ".

func Info

func Info(v ...interface{})

Info is equivalent to log.Print, but prefixed with "[INFO] ".

func Infof

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

Infof is equivalent to log.Printf, but prefixed with "[INFO] ".

func Warning

func Warning(v ...interface{})

Warning is equivalent to log.Print, but prefixed with "[WARNING] ".

func Warningf

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

Warningf is equivalent to log.Printf, but prefixed with "[WARNING] ".

Types

type P

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

P is a logger that includes the plugin doing the logging.

func NewWithPlugin

func NewWithPlugin(name string) P

NewWithPlugin returns a logger that includes "plugin/name: " in the log message. I.e [INFO] plugin/<name>: message.

func (P) Debug

func (p P) Debug(v ...interface{})

Debug logs as log.Debug.

func (P) Debugf

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

Debugf logs as log.Debugf.

func (P) Error

func (p P) Error(v ...interface{})

Error logs as log.Error.

func (P) Errorf

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

Errorf logs as log.Errorf.

func (P) Info

func (p P) Info(v ...interface{})

Info logs as log.Info.

func (P) Infof

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

Infof logs as log.Infof.

func (P) Warning

func (p P) Warning(v ...interface{})

Warning logs as log.Warning.

func (P) Warningf

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

Warningf logs as log.Warningf.

Jump to

Keyboard shortcuts

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