logging

package
v0.0.0-...-ce263d7 Latest Latest
Warning

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

Go to latest
Published: Jul 25, 2022 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// DebugLevel logs are typically voluminous, and are usually disabled in
	// production.
	DebugLevel = "debug"
	// InfoLevel is the default logging priority.
	InfoLevel = "info"
	// WarnLevel logs are more important than Info, but don't need individual
	// human review.
	WarnLevel = "warn"
	// ErrorLevel logs are high-priority. If an application is running smoothly,
	// it shouldn't generate any error-level logs.
	ErrorLevel = "error"
	// DPanicLevel logs are particularly important errors. In development the
	// logger panics after writing the message.
	DPanicLevel = "dpanic"
	// PanicLevel logs a message, then panics.
	PanicLevel = "panic"
	// FatalLevel logs a message, then calls os.Exit(1).
	FatalLevel = "fatal"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ErrCloser

type ErrCloser struct {
	Errors []error
}

func (*ErrCloser) Error

func (e *ErrCloser) Error() string

type Field

type Field = zap.Field

func String

func String(key, data string) Field

type Logger

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

func NewLogger

func NewLogger(cfg config.Config) (*Logger, error)

func (*Logger) Close

func (l *Logger) Close() error

func (*Logger) DPanic

func (l *Logger) DPanic(msg string, fields ...Field)

func (*Logger) Debug

func (l *Logger) Debug(msg string, fields ...Field)

func (*Logger) Error

func (l *Logger) Error(msg string, fields ...Field)

func (*Logger) Fatal

func (l *Logger) Fatal(msg string, fields ...Field)

func (*Logger) Info

func (l *Logger) Info(msg string, fields ...Field)

func (*Logger) Panic

func (l *Logger) Panic(msg string, fields ...Field)

func (*Logger) Sync

func (l *Logger) Sync() error

func (*Logger) Warn

func (l *Logger) Warn(msg string, fields ...Field)

Jump to

Keyboard shortcuts

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