# README
Deprecated
The development of this library is discontinued and we encourage you to avoid using it in new projects. There are better alternatives out there.
logging
Simple logging package in Go used at Cabify. Originally forked from cenkalti/log
Install
$ go get github.com/cabify/go-logging
Features
- Log levels (DEBUG, INFO, NOTICE, WARNING, ERROR, CRITICAL)
- Different colored output for different log levels
- Customizable logging handlers
- Customizable formatters
- Log to multiple backends concurrently
Example Usage
See https://github.com/cabify/go-logging/blob/master/example/example.go
# Functions
Baggage is a handy helper to extract the baggage from the context, probably to be used with another logger.
ConfigureDefaultLogger configures loggers for your service, optionally adding log message counters with your favorite metrics system.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
For provides a logger which is aware of the passed context and will prepend the context baggage values, using DefaultLogger as base logger.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
NewContextFromWithValue creates a new context with baggage values from ctx plus the provided one it's just a shorthand for the composition of NewContextWithBaggageFrom and WithBaggageValue.
NewContextWithBaggageFrom returns a new context with baggage values obtained from another context.
NewFactory instantiates a factory with the default logger.
No description provided by the author
NewID returns a random id to follow the log traces.
NewLogger returns a new Logger implementation.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
SetLevel changes the level of DefaultLogger and DefaultHandler.
No description provided by the author
No description provided by the author
No description provided by the author
WithBaggageValue returns a context with the added key value pair in the baggage store.
WithBaggageValues returns a context with all key value pairs added to the baggage store.
# 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.
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
BaggageContextKey is the key to be used for the baggage map[string]interface{} in context.*Value.
DefaultFactory is the factory used to create new loggers.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
# Structs
No description provided by the author
Config defines the logging configuration.
Factory provides context aware loggers.
FileHandler is a handler implementation that writes the logging output to a *os.File.
MultiHandler sends the log output to multiple handlers concurrently.
NoDebugLogger embeds a Logger, but in calls to debug functions it does nothing.
Record contains all of the information about a single log message.
SyslogHandler sends the logging output to syslog.
WriterHandler is a handler implementation that writes the logging output to a io.Writer.
# Interfaces
Formatter formats a record.
Handler handles the output.
Logger is the interface for outputing log messages in different levels.
LoggerFactory creates Logger instances.
# Type aliases
No description provided by the author
CountLogMessage offers a method to count log messages logged by the logger.
No description provided by the author