log

package
v0.0.0-...-ac81b06 Latest Latest
Warning

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

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

Documentation

Overview

Package log provides a utility to log timestamped messages to an io.Writer.

Index

Constants

View Source
const (
	Always = iota
	Info
	DebugLow
	DebugHigh
)

Tool Logger verbosity constants

View Source
const (
	ToolTimeFormat = "2006-01-02T15:04:05.000-0700"
)

Variables

This section is empty.

Functions

func Log

func Log(minVerb int, msg string)

func Logf

func Logf(minVerb int, format string, a ...interface{})

func SetDateFormat

func SetDateFormat(dateFormat string)

func SetVerbosity

func SetVerbosity(verbosity VerbosityLevel)

func SetWriter

func SetWriter(writer io.Writer)

func Writer

func Writer(minVerb int) io.Writer

Types

type ToolLogger

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

func NewToolLogger

func NewToolLogger(verbosity VerbosityLevel) *ToolLogger

func (*ToolLogger) Log

func (tl *ToolLogger) Log(minVerb int, msg string)

func (*ToolLogger) Logf

func (tl *ToolLogger) Logf(minVerb int, format string, a ...interface{})

func (*ToolLogger) SetDateFormat

func (tl *ToolLogger) SetDateFormat(dateFormat string)

func (*ToolLogger) SetVerbosity

func (tl *ToolLogger) SetVerbosity(level VerbosityLevel)

func (*ToolLogger) SetWriter

func (tl *ToolLogger) SetWriter(writer io.Writer)

func (*ToolLogger) Writer

func (tl *ToolLogger) Writer(minVerb int) io.Writer

Writer returns an io.Writer that writes to the logger with the given verbosity

type VerbosityLevel

type VerbosityLevel interface {
	Level() int
	IsQuiet() bool
}

Jump to

Keyboard shortcuts

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