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
+7 -2
View File
@@ -15,7 +15,7 @@ import (
func setupPool(t *testing.T) *Pool {
t.Helper()
pool, err := NewPool(context.Background(), nil, nil)
pool, err := NewPool(context.Background(), "pool-1", nil, nil)
assert.NoError(t, err)
return pool
}
@@ -39,6 +39,11 @@ func expectEvent(
// Tests
func TestPoolID(t *testing.T) {
_, err := NewPool(context.Background(), "", nil, nil)
assert.ErrorIs(t, err, ErrInvalidPoolID)
}
func TestPoolAdd(t *testing.T) {
t.Run("successfully adds peer", func(t *testing.T) {
pool := setupPool(t)
@@ -341,7 +346,7 @@ func TestPoolEvents(t *testing.T) {
)
assert.NoError(t, err)
pool, err := NewPool(context.Background(), config, nil)
pool, err := NewPool(context.Background(), "pool-1", config, nil)
assert.NoError(t, err)
defer pool.Close()