commonlog: github.com/Rican7/commonlog Index | Files | Directories

package commonlog

import "github.com/Rican7/commonlog"

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

Index

Package Files

common.go logger.go

type LevelLogger Uses

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 Uses

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 Uses

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

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

Package commonlog imports 1 packages (graph) and is imported by 6 packages. Updated 2016-11-06. Refresh now. Tools for package owners.