asynczap

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: 2 Imported by: 0

Documentation

Overview

Package asynczap is the package that provides the AsyncZap logger.

Package asynczap is the package that provides the AsyncZap logger.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AsyncZap

type AsyncZap struct {
	Logger logger.Logger
	// contains filtered or unexported fields
}

AsyncZap defines an object that performs asynchronous logging and implements log.Logger.

func NewAsyncZap

func NewAsyncZap(l logger.Logger) *AsyncZap

NewAsyncZap creates a new AsyncZap instance.

func (*AsyncZap) Close

func (a *AsyncZap) Close() (err error)

Close closes the logger.

func (*AsyncZap) DPanic

func (a *AsyncZap) DPanic(msg string, keysAndValues ...any)

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

func (*AsyncZap) Debug

func (a *AsyncZap) Debug(msg string, keysAndValues ...any)

Debug logs a message with some additional context.

func (*AsyncZap) Error

func (a *AsyncZap) Error(msg string, keysAndValues ...any)

Error logs a message with some additional context.

func (*AsyncZap) Fatal

func (a *AsyncZap) Fatal(msg string, keysAndValues ...any)

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

func (*AsyncZap) Info

func (a *AsyncZap) Info(msg string, keysAndValues ...any)

Info logs a message with some additional context.

func (*AsyncZap) Panic

func (a *AsyncZap) Panic(msg string, keysAndValues ...any)

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

func (*AsyncZap) Warn

func (a *AsyncZap) Warn(msg string, keysAndValues ...any)

Warn logs a message with some additional context.

func (*AsyncZap) Work

func (a *AsyncZap) Work()

Work is a function which processes Job instances in the AsyncZap queue.

type Job

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

Job defines an object which is used to enqueue logging jobs for AsyncZap.

func NewJob

func NewJob(l zapcore.Level, m string, kv []any) *Job

NewJob creates a new Job instance.

Jump to

Keyboard shortcuts

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