logger

package
v0.25.1 Latest Latest
Warning

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

Go to latest
Published: Sep 29, 2021 License: GPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNilLogger = errors.New("logger is nil")

ErrNilLogger is returned by functions that expect a non-nil Logger, but received nil.

Functions

This section is empty.

Types

type Logger

type Logger = zap.Logger

Logger represents the component for writing messages to log.

It is a type alias of go.uber.org/zap.Logger.

func NewLogger

func NewLogger(prm Prm) (*Logger, error)

NewLogger constructs a new zap logger instance.

Logger is built from production logging configuration with:

  • parameterized level;
  • console encoding;
  • ISO8601 time encoding.

Logger records a stack trace for all messages at or above fatal level.

type Prm added in v0.20.0

type Prm struct {
	// contains filtered or unexported fields
}

Prm groups Logger's parameters.

func (*Prm) SetLevelString added in v0.20.0

func (p *Prm) SetLevelString(s string) error

SetLevelString sets minimum logging level.

Returns error of s is not a string representation of zap.Level value (see zapcore.Level docs).

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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