logging

package
v0.0.0-...-82afb99 Latest Latest
Warning

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

Go to latest
Published: May 16, 2018 License: Apache-2.0 Imports: 2 Imported by: 16

Documentation

Overview

Package logging provides standard log.Logger wrappers around the github.com/golang/glog package. These wrappers can be set with log message prefixes.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PrintMulti

func PrintMulti(logger PrintLogger, msgMap map[Level]string)

PrintMulti logs the highest level message that is at or below the configured glog level

Types

type InfoLogger

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

InfoLogger is a simple wrapper around glog that provides a way to easily create loggers at a particular log level.

func (*InfoLogger) Print

func (l *InfoLogger) Print(v ...interface{})

Print prints directly to the info logger regardless of level

func (*InfoLogger) Printf

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

Printf prints directly to the info logger regardless of level

func (*InfoLogger) V

func (l *InfoLogger) V(level Level) *log.Logger

V returns a standard log.Logger at the particular log level. Logs will only be printed if glog was set up at a level equal to or higher than the level provided to V.

type Level

type Level glog.Level

type Logger

type Logger struct {
	Info  *InfoLogger
	Error *log.Logger
}

func New

func New(prefix string) *Logger

type PrintLogger

type PrintLogger interface {
	Print(v ...interface{})
	Printf(format string, v ...interface{})
}

PrintLogger is a simple interface for loggers that is implemented by both info and error loggers

Jump to

Keyboard shortcuts

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