log

package
v0.0.0-...-eafbfb8 Latest Latest
Warning

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

Go to latest
Published: Dec 21, 2016 License: AGPL-3.0 Imports: 5 Imported by: 0

Documentation

Overview

Package log implements a simple leveled logging scheme.

Index

Constants

View Source
const (

	// LevelError is the ERROR log level (NOTICE/ERROR).
	LevelError = iota

	// LevelWarn is the WARN log level,  (NOTICE/ERROR/WARN).
	LevelWarn

	// LevelInfo is the INFO log level, (NOTICE/ERROR/WARN/INFO).
	LevelInfo

	// LevelDebug is the DEBUG log level, (NOTICE/ERROR/WARN/INFO/DEBUG).
	LevelDebug
)

Variables

This section is empty.

Functions

func Debugf

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

Debugf logs the given format string/arguments at the DEBUG log level.

func ElideAddr

func ElideAddr(addrStr string) string

ElideAddr transforms the string representation of the provided address based on the unsafeLogging setting. Callers that wish to log IP addreses should use ElideAddr to sanitize the contents first.

func ElideError

func ElideError(err error) string

ElideError transforms the string representation of the provided error based on the unsafeLogging setting. Callers that wish to log errors returned from Go's net package should use ElideError to sanitize the contents first.

func Errorf

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

Errorf logs the given format string/arguments at the ERROR log level.

func Infof

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

Infof logs the given format string/arguments at the INFO log level.

func Noticef

func Noticef(format string, a ...interface{})

Noticef logs the given format string/arguments at the NOTICE log level. Unless logging is disabled, Noticef logs are always emitted.

func SetLogLevel

func SetLogLevel(logLevelStr string) error

SetLogLevel sets the log level to the value indicated by the given string (case-insensitive).

func SetLogger

func SetLogger(l *golog.Logger)

SetLogger sets the logging backend to the specified log.Logger.

func Warnf

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

Warnf logs the given format string/arguments at the WARN log level.

Types

This section is empty.

Jump to

Keyboard shortcuts

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