Documentation ¶
Overview ¶
Package logger is intended to abstract our concrete logging backend, to not litter all the code base with "sirupsen/logrus" imports; also makes it easier to eventually switch out the logging library.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ParseZapEncoding ¶
ParseZapEncoding takes a string and returns a valid Zap encoding, defaulting to "console".
func ParseZapLevel ¶
ParseZapLevel takes a string and returns a zap.Level. It the level is unrecognized, it returns the default level.
Types ¶
type KV ¶
KV is the type for field literals. These are key/value pairs, hence "KV". We declare it as an alias to the logrus.Fields type which is a type defined as map[string]interface{}.
type Logger ¶
type Logger interface { // grpclog uses this to determine log levels V(i int) bool // NewEntry returns a new logrus.Entry to be used with grpc_logrus middleware NewEntry() *logrus.Entry logrus.FieldLogger }
Logger is the interface provided by our logger abstraction
func NewLogrusStandardLogger ¶
func NewLogrusStandardLogger() Logger
NewLogrusStandardLogger returns a new logger.Logger wrapping the logrus standard logger (i.e. what you get when calling the package-level methods, like `logrus.Info(...)`).
func NewTestLogger ¶
func NewTestLogger() Logger
NewTestLogger returns a logger that discards all output -- to keep test output undisturbed.