Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var DefaultCtxLoggerKey = CtxLoggerKey("sm-ctx-logger")
DefaultCtxLoggerKey defines the key under which the logger is being stored
Functions ¶
func WithFields ¶
WithFields adds all passed in zap fields to the Logger stored in ctx and overwrites it for further use
Types ¶
type CtxLoggerKey ¶
type CtxLoggerKey string
CtxLoggerKey defines the key under which the logger is being stored
type Logger ¶
type Logger struct { *zap.Logger Sentry *raven.Client Level zap.AtomicLevel // contains filtered or unexported fields }
Logger implements Context
func New ¶
New Logger instance with an optional sentry key. If no sentry dsn is provided, the sentry encoding is disabled If local is true, logs will be provided in a human readable format, false will print stackdriver conformant logs as json
func NewNop ¶
func NewNop() *Logger
NewNop returns Logger with empty logging, tracing and ErrorReporting
func NewWithLevel ¶ added in v1.0.3
NewWithLevel builds a Logger instance with an optional sentry key and the predefined level. If no sentry dsn is provided, the sentry encoding is disabled If local is true, logs will be provided in a human readable format, false will print stackdriver conformant logs as json
func WithFieldsOverwrite ¶
WithFieldsOverwrite adds all passed in zap fields to the Logger stored in ctx and overwrites it for further use WARNING: This might kill thread safety - Experimental and bad practice - DO NOT USE!
func (*Logger) WithFields ¶
WithFields wrapper around zap.With
func (*Logger) WithRelease ¶
WithRelease returns a new logger updating the internal sentry client with release info This should be the first change to the logger (before adding fields) as otherwise the change might not be persisted