zapconfigs

package module
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 27, 2019 License: MIT Imports: 3 Imported by: 7

README

Provides a few more opinionated zap logger configurations beyond the ones provided by zap's package.

Documentation

Overview

Package zapconfigs provides a few more opinionated zap logger configurations beyond the ones provided by their package.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewDebugEncoderConfig

func NewDebugEncoderConfig() zapcore.EncoderConfig

func NewDebugLogger

func NewDebugLogger(options ...zap.Option) *zap.Logger

NewDebugLogger provides a logger suitable for logging in production code, but at debug level. This and NewDefaultLogger both use "console" style encoding to ensure that they are interchangeable. If an error occurs during logger creation, then log.Fatal is used to report the error and exit.

func NewDefaultEncoderConfig

func NewDefaultEncoderConfig() zapcore.EncoderConfig

func NewDefaultLogger

func NewDefaultLogger(options ...zap.Option) *zap.Logger

NewDefaultLogger provides a human-readable logger suitable for production code. It logs at info level and excludes the caller and stack trace fields. This and NewDebugLogger both use "console" style encoding to ensure that they are interchangeable. If an error occurs during logger creation, then log.Fatal is used to report the error and exit.

func NewLeveledLogger

func NewLeveledLogger(level zapcore.Level, options ...zap.Option) *zap.Logger

NewLeveledLogger is the same as NewDefaultLogger but allows for specifying the logging level.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL