modulepackage
0.0.0-20160720134017-8b5a689ed69b
Repository: https://github.com/koding/logging.git
Documentation: pkg.go.dev
# README
logging
Simple logging package in Go.
Install
$ go get github.com/koding/logging
Features
- Log levels (DEBUG, INFO, NOTICE, WARNING, ERROR, CRITICAL)
- Different colored output for different levels (can be disabled)
- No global state in package
- Customizable logging handlers
- Customizable formatters
- Log to multiple backends concurrently
- Context based (inherited) loggers
Example Usage
See https://github.com/koding/logging/blob/master/example/example.go
# Packages
No description provided by the author
# Functions
Critical prints a critical level log message to the stderr.
Debug prints a debug level log message to the stderr.
Error prints a error level log message to the stderr.
Fatal is equivalent to Critical() followed by a call to os.Exit(1).
Info prints a info level log message to the stderr.
NewBaseHandler creates a newBaseHandler with default values.
No description provided by the author
NewLogger returns a new Logger implementation.
NewMultiHandler creates a new handler with given handlers.
NewSinkHandler creates SinkHandler with sink channel buffer size bufSize that wraps inner handler for writing logs.
No description provided by the author
NewWriterHandler creates a new writer handler with given io.Writer.
Notice prints a notice level log message to the stderr.
Panic is equivalent to Critical() followed by a call to panic().
Warning prints a warning level log message to the stderr.
# Constants
Colors for different log levels.
Colors for different log levels.
Logging levels.
Colors for different log levels.
Logging levels.
Logging levels.
Colors for different log levels.
Logging levels.
Colors for different log levels.
Logging levels.
Colors for different log levels.
Logging levels.
Colors for different log levels.
Colors for different log levels.
# Variables
DefaultFormatter holds default formatter for loggers.
DefaultHandler holds default handler for loggers.
DefaultLevel holds default value for loggers.
DefaultLogger holds default logger.
LevelColors provides mapping for log colors.
LevelNames provides mapping for log levels.
StderrHandler holds a handler with outputting to stderr.
StdoutHandler holds a handler with outputting to stdout.
# Structs
BaseHandler provides basic functionality for handler.
No description provided by the author
MultiHandler sends the log output to multiple handlers concurrently.
Record contains all of the information about a single log message.
SinkHandler sends log records to buffered channel, the logs are written in a dedicated routine consuming the channel.
SyslogHandler sends the logging output to syslog.
WriterHandler is a handler implementation that writes the logging output to a io.Writer.