logzap

package
v2.1.0 Latest Latest
Warning

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

Go to latest
Published: May 2, 2026 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package logzap adapts zap logging to the core logger port.

Use NewProduction or NewDevelopment when application wiring needs a concrete ports.Logger. The adapter owns zap-specific dependencies in contrib so stable core packages do not import zap.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(z *zap.Logger) ports.Logger

New wraps a zap.Logger as a ports.Logger.

func NewDevelopment

func NewDevelopment(level string) ports.Logger

NewDevelopment creates a human-friendly logger for local dev (console, colors).

func NewProduction

func NewProduction() ports.Logger

NewProduction creates a production logger (JSON, no colors).

func NewProductionWithLevel

func NewProductionWithLevel(level string) ports.Logger

NewProductionWithLevel creates a production logger with custom level.

Types

type ZapLogger

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

ZapLogger adapts zap to the shared.Logger interface.

func (*ZapLogger) Debug

func (l *ZapLogger) Debug(msg string, kv ...any)

Debug logs a debug message with structured fields.

func (*ZapLogger) Error

func (l *ZapLogger) Error(msg string, kv ...any)

Error logs an error message with structured fields.

func (*ZapLogger) Info

func (l *ZapLogger) Info(msg string, kv ...any)

Info logs an info message with structured fields.

func (*ZapLogger) Warn

func (l *ZapLogger) Warn(msg string, kv ...any)

Warn logs a warning message with structured fields.

Jump to

Keyboard shortcuts

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