golog

package
v0.0.0-...-fd97e0e Latest Latest
Warning

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

Go to latest
Published: Mar 16, 2016 License: Apache-2.0, Apache-2.0 Imports: 12 Imported by: 0

README

golog Travis CI Status Coverage Status GoDoc

Provides logging used in many getlantern components.

GoDoc

Documentation

Overview

package golog implements logging functions that log errors to stderr and debug messages to stdout. Trace logging is also supported. Trace logs go to stdout as well, but they are only written if the program is run with environment variable "TRACE=true". A stack dump will be printed after the message if "PRINT_STACK=true".

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetOutputs

func GetOutputs() *outputs

func ResetOutputs

func ResetOutputs()

func SetOutputs

func SetOutputs(errorOut io.Writer, debugOut io.Writer)

Types

type Logger

type Logger interface {
	// Debug logs to stdout
	Debug(arg interface{})
	// Debugf logs to stdout
	Debugf(message string, args ...interface{})

	// Error logs to stderr
	Error(arg interface{})
	// Errorf logs to stderr
	Errorf(message string, args ...interface{})

	// Fatal logs to stderr and then exits with status 1
	Fatal(arg interface{})
	// Fatalf logs to stderr and then exits with status 1
	Fatalf(message string, args ...interface{})

	// Trace logs to stderr only if TRACE=true
	Trace(arg interface{})
	// Tracef logs to stderr only if TRACE=true
	Tracef(message string, args ...interface{})

	// TraceOut provides access to an io.Writer to which trace information can
	// be streamed. If running with environment variable "TRACE=true", TraceOut
	// will point to os.Stderr, otherwise it will point to a ioutil.Discared.
	// Each line of trace information will be prefixed with this Logger's
	// prefix.
	TraceOut() io.Writer

	// IsTraceEnabled() indicates whether or not tracing is enabled for this
	// logger.
	IsTraceEnabled() bool

	// AsStdLogger returns an standard logger
	AsStdLogger() *log.Logger
}

func LoggerFor

func LoggerFor(prefix string) Logger

Jump to

Keyboard shortcuts

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