/zaphandler

zaphandler will help to create slog handler using zap logger

Primary LanguageGoMIT LicenseMIT

zaphandler

zaphandler will help to create slog handler using zap logger Go Version Go Reference License Report Card

Example:

package main

import (
    "go.mrchanchal.com/zaphandler"
    "go.uber.org/zap"
    "golang.org/x/exp/slog"
)

func main() {
    zapL, _ := zap.NewDevelopment()
    defer zapL.Sync()

    logger := slog.New(zaphandler.New(zapL))

    logger.Info("sample log message", "field1", "value1", "field2", 33)
}

Go Playground