zap

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Feb 12, 2023 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package zap is the package that provides the Zap logger.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Params

type Params struct {
	// Path is the path to the log file.
	Path string

	// RetainDays is the number of days to retain log files.
	RetainDays int

	// RetainCopies is the number of log files to retain.
	RetainCopies int
}

Params defines the parameters for the Zap logger.

type Zap

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

Zap defines an object that performs logging and implements log.Logger.

func NewZap

func NewZap(c *Params) *Zap

NewZap creates a new Zap instance.

func (*Zap) Close

func (z *Zap) Close() (err error)

Close closes the logger.

func (*Zap) DPanic

func (z *Zap) DPanic(msg string, keysAndValues ...any)

DPanic logs a message with some additional context. In development mode, the logger then panics.

func (*Zap) Debug

func (z *Zap) Debug(msg string, keysAndValues ...any)

Debug logs a message with some additional context.

func (*Zap) Error

func (z *Zap) Error(msg string, keysAndValues ...any)

Error logs a message with some additional context.

func (*Zap) Fatal

func (z *Zap) Fatal(msg string, keysAndValues ...any)

Fatal logs a message with some additional context, then calls os.Exit.

func (*Zap) Info

func (z *Zap) Info(msg string, keysAndValues ...any)

Info logs a message with some additional context.

func (*Zap) Panic

func (z *Zap) Panic(msg string, keysAndValues ...any)

Panic logs a message with some additional context, then panics.

func (*Zap) Warn

func (z *Zap) Warn(msg string, keysAndValues ...any)

Warn logs a message with some additional context.

Jump to

Keyboard shortcuts

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