Documentation
¶
Index ¶
- func AddFlags(v *viper.Viper, f *pflag.FlagSet)
- func LoggerFromContext(ctx context.Context) *zap.Logger
- func LoggerWithFieldsFromContext(ctx context.Context) *zap.Logger
- func LoggerWithFieldsFromNamespaceContext(ctx context.Context, namespaces ...string) *zap.Logger
- func NewLogger(level Level, format Format) (*zap.Logger, error)
- func TagsToFields(tags []*tag.Tag) []zap.Field
- func WithLogger(ctx context.Context, logger *zap.Logger) context.Context
- type Format
- type Level
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func LoggerFromContext ¶
LoggerFromContext returns a logger from the given context with the default namespace tags attached to it
func LoggerWithFieldsFromContext ¶
LoggerWithFieldsFromContext returns a logger from the given context with the default namespace tags attached to it
func LoggerWithFieldsFromNamespaceContext ¶
LoggerWithFieldsFromNamespaceContext returns a logger from the given context. It loads the tags from the provided tags namespace and adds them to the logger.
func TagsToFields ¶
TagsToFields converts a slice of tags to zap fields
Types ¶
Click to show internal directories.
Click to hide internal directories.