Documentation ¶
Overview ¶
Package logging is a wrapper around Uber's zap logger, which has many configuration possibilities, so this package simplifies the instantiation of the logger. Services can still create their own zap logger.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Logger ¶
type Logger interface { Debug(msg string, fields ...zap.Field) Info(msg string, fields ...zap.Field) Warn(msg string, fields ...zap.Field) Error(msg string, fields ...zap.Field) Fatal(msg string, fields ...zap.Field) }
func ConfigureLogger ¶
func ConfigureLogger(loggerType LoggerType) (Logger, error)
ConfigureLogger takes in a logger type, and returns the logger for that environment. For tests, it returns a Nop logger. For development, it returns a logger that writes to the console in a human readable way, with caller and stack traces enabled for warn level errors. For production, it removes the callers and stack traces (except in Error level logs) in favor of speed/performance.
type LoggerType ¶
type LoggerType string
const ( DevLogger LoggerType = "dev-logger" ProdLogger LoggerType = "prod-logger" TestLogger LoggerType = "test-logger" )
Click to show internal directories.
Click to hide internal directories.