zaplogger

package module
v0.0.0-...-47b447a Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2026 License: MIT Imports: 3 Imported by: 0

README

work-zaplogger

Zap Logger interface for github.com/taylorchu/work

Example

import (
	"go.uber.org/zap"
    zaplogger "src.techknowlgick.com/work-zaplogger"
	"github.com/taylorchu/work"
)

logger, _ := zap.NewProduction()

jobOpts := &work.JobOptions{
	MaxExecutionTime: time.Minute,
	IdleWait:         4 * time.Second,
	NumGoroutines:    4,
	HandleMiddleware: []work.HandleMiddleware{
		zaplogger.HandleFuncLoggerZap(logger), // add middleware here
	},
}

Credits/License

This project is a largely based on the existing logrus middleware implementation in work, which is licensed under the MIT license, so this project is also licensed under the MIT license to ensure compliance. A very big thank you to Taylor Chu for their work (no pun intended) on work.

You can see work, and it's documentation here: https://github.com/taylorchu/work

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EnqueueFuncLogger

func EnqueueFuncLogger(l *zap.Logger) work.EnqueueMiddleware

EnqueueFuncLogger logs job enqueuing with logrus structured logger.

func HandleFuncLogger

func HandleFuncLogger(l *zap.Logger) work.HandleMiddleware

HandleFuncLogger logs job execution with logrus structured logger.

Types

This section is empty.

Jump to

Keyboard shortcuts

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