commonlog

package module
v0.0.0-...-5bc14d6 Latest Latest
Warning

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

Go to latest
Published: Feb 23, 2016 License: MIT Imports: 1 Imported by: 6

README

commonlog

GoDoc Build Status

A common logger interface with multiple adapters for Go

This library defines interfaces for common logging interactions, with an emphasis on Syslog level compatibility, as specified in RFC 5424.

Install

go get github.com/Rican7/commonlog

Documentation

Overview

Package commonlog defines interfaces for common logging interactions, with an emphasis on Syslog level compatibility

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type LevelLogger

type LevelLogger interface {
	Log(level.LogLevel, string, ...interface{})
}

LevelLogger is an interface containing a single method that logs a message and context/formatting values to a specified a level

type Logger

type Logger interface {
	LevelLogger

	Emergency(string, ...interface{})
	Alert(string, ...interface{})
	Critical(string, ...interface{})
	Error(string, ...interface{})
	Warning(string, ...interface{})
	Notice(string, ...interface{})
	Info(string, ...interface{})
	Debug(string, ...interface{})
}

A Logger defines the method set for a common logging implementation, with methods defined for each standard log level as defined in package level

func NewLogger

func NewLogger(l LevelLogger) Logger

NewLogger creates a new Logger instance from a LevelLogger by using a common pass-through pattern for each separate level-specific logging method to the passed LevelLogger.Log() method

Directories

Path Synopsis
Package adapter defines a common interface for adapters to implement the commonlog.Logger with a self-awareness
Package adapter defines a common interface for adapters to implement the commonlog.Logger with a self-awareness
builtin
Package builtin defines an adapter using the built-in "log" package
Package builtin defines an adapter using the built-in "log" package
glog
Package glog defines an adapter using the google "glog" package
Package glog defines an adapter using the google "glog" package
iowriter
Package iowriter defines an adapter that uses the io.Writer interface
Package iowriter defines an adapter that uses the io.Writer interface
levelprefixed
Package levelprefixed defines a delegate adapter that prefixes messages with the log's severity level
Package levelprefixed defines a delegate adapter that prefixes messages with the log's severity level
logging
Package logging defines an adapter using the popular "go-logging" package
Package logging defines an adapter using the popular "go-logging" package
Package level defines the standard levels and their validations
Package level defines the standard levels and their validations

Jump to

Keyboard shortcuts

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