Documentation
¶
Index ¶
- Constants
- Variables
- func AddToContext(c context.Context, label string, value interface{}) context.Context
- func Debug(args ...interface{})
- func Error(args ...interface{})
- func HeadersFromContext(c context.Context, headerMap map[string]string) map[string][]string
- func Info(args ...interface{})
- func New() *logWriter
- type Logger
Constants ¶
View Source
const DEFAULT_APPNAME = "unconfigured-app"
View Source
const DEFAULT_ENVIRONMENT = "unconfigured"
View Source
const DEFAULT_LEVEL = logrus.InfoLevel
Variables ¶
View Source
var AppName string
View Source
var Environment string
View Source
var HostName string
Functions ¶
func AddToContext ¶
AddToContext adds a value to the context Any future logging using this context will include this field with the given label
func HeadersFromContext ¶
HeadersFromContext accepts a map[string]string with context keys as keys and header names as values. It returns a map[string]string that can be used to set headers on new requests or reaponses
Types ¶
type Logger ¶
type Logger interface {
WithError(err error) Logger
Error(args ...interface{})
WithField(key string, value interface{}) Logger
WithFields(map[string]interface{}) Logger
Info(args ...interface{})
}
func WithFields ¶
WithFields returns a reusable logger interface decorated with any number of "key=value" tags
Click to show internal directories.
Click to hide internal directories.