Add slog attributes at pool, worker, and connection levels.

This commit is contained in:
Jay
2026-04-23 17:58:40 -04:00
parent 91717457dd
commit 727dc18b57
17 changed files with 488 additions and 248 deletions
+4
View File
@@ -6,6 +6,7 @@ import (
"git.wisehodl.dev/jay/go-honeybee/queue"
"git.wisehodl.dev/jay/go-honeybee/transport"
"git.wisehodl.dev/jay/go-honeybee/types"
"log/slog"
"sync"
"time"
)
@@ -31,6 +32,7 @@ type DefaultWorker struct {
config *WorkerConfig
ctx context.Context
cancel context.CancelFunc
logger *slog.Logger
}
func NewWorker(
@@ -38,6 +40,7 @@ func NewWorker(
id string,
conn *transport.Connection,
config *WorkerConfig,
logger *slog.Logger,
) (*DefaultWorker, error) {
if config == nil {
config = GetDefaultWorkerConfig()
@@ -54,6 +57,7 @@ func NewWorker(
config: config,
ctx: wctx,
cancel: cancel,
logger: logger,
}, nil
}