zap

package
v0.0.0-...-62c6052 Latest Latest
Warning

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

Go to latest
Published: Feb 21, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package zap implements a mapper from "go.uber.org/zap"

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func NewDevLogger

func NewDevLogger() log.ContextualExtendedLogger

func NewProdLogger

func NewProdLogger() log.ContextualExtendedLogger

Types

type Kind

type Kind int
const (
	DEV Kind = iota
	PROD
	CONSOLE
)

type Logger

type Logger struct {
	*zap.SugaredLogger
}

Logger is an Contextual logger wrapper over Logrus's logger.

func (Logger) Log

func (l Logger) Log(lvl log.Level, args ...interface{})

func (Logger) Output

func (l Logger) Output() io.Writer

func (Logger) Print

func (l Logger) Print(args ...interface{})

func (Logger) Printf

func (l Logger) Printf(fmt string, args ...interface{})

func (Logger) Println

func (l Logger) Println(args ...interface{})

func (Logger) SetOutput

func (l Logger) SetOutput(io.Writer)

func (Logger) With

func (l Logger) With(fields ...interface{}) log.LeveledExtended

With wraps the zap sugared logger's With-method, which returns an explicit *zap.Sugared, which can't be abstracted without a wrapper :(

func (Logger) Write

func (l Logger) Write(b []byte) (int, error)

func (Logger) Zap

func (l Logger) Zap() *zap.SugaredLogger

Jump to

Keyboard shortcuts

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