log

package module
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Dec 22, 2015 License: MIT Imports: 6 Imported by: 7

README

log

GoDoc

Logger interface with basic implementation

Documentation

Overview

Package log defines common logging interface with basic implementation.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Debug

func Debug(msg string, args ...interface{})

Debug log.

func Error

func Error(msg string, args ...interface{})

Error log.

func Errorf

func Errorf(msg string, args ...interface{})

Errorf log.

func Fatal

func Fatal(msg string, args ...interface{})

Fatal log.

func Info

func Info(msg string, args ...interface{})

Info log.

func SetLogger

func SetLogger(l Logger)

SetLogger replaces default Logger.

func Warning

func Warning(msg string, args ...interface{})

Warning log.

Types

type DebugLogger

type DebugLogger interface {
	Logger
	Enabled() bool
	Err(op string, err error) error
}

DebugLogger with extra utilities.

func IfDebug

func IfDebug(module string) DebugLogger

IfDebug returns non empty logger if debug configuration property contains given module.

type Logger

type Logger interface {
	// Debug log.
	Debug(msg string, args ...interface{})
	// Info log.
	Info(msg string, args ...interface{})
	// Warning log.
	Warning(msg string, args ...interface{})
	// Error log.
	Error(msg string, args ...interface{})
	// Fatal log.
	Fatal(msg string, args ...interface{})
}

Logger defines common logger interface.

func GetDefaultLogger

func GetDefaultLogger() Logger

GetDefaultLogger returns builtin Logger implementation

func GetLogger

func GetLogger() Logger

GetLogger returns current default logger

Jump to

Keyboard shortcuts

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