logging

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Aug 15, 2023 License: MIT Imports: 1 Imported by: 0

Documentation

Overview

Package logging provides the logger interface for XSQS

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Log

type Log interface {
	// Infow logs an informational message with optional key-value pairs.
	Infow(msg string, kv ...any)
	// Warnw logs a warning message with optional key-value pairs.
	Warnw(msg string, kv ...any)
	// Errorw logs an error message with optional key-value pairs.
	Errorw(msg string, kv ...any)
	// With returns a new logger instance with additional key-value pairs.
	With(kv ...any) Log
}

Log is the interface for a logger.

func DefaultZapAdapter

func DefaultZapAdapter() Log

DefaultZapAdapter returns a new instance of the ZapAdapter as the default logger.

type ZapAdapter

type ZapAdapter struct {
	*zap.SugaredLogger
}

ZapAdapter is an implementation of the Log interface using the Zap logger.

func (ZapAdapter) With

func (log ZapAdapter) With(kv ...any) Log

With returns a new Log instance with additional key-value pairs.

Jump to

Keyboard shortcuts

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