1
0
mirror of https://github.com/taigrr/log-socket synced 2026-03-20 19:32:25 -07:00

feat(slog): add slog.Handler adapter (#20)

* docs: add example programs for common usage patterns

Adds four focused examples in examples/ directory:
- basic: drop-in logger with web UI
- namespaces: namespace-based logging by component
- client: programmatic log client with filtering
- log-levels: all log levels and filtering

Fixes #7

* feat(slog): add slog.Handler adapter for log-socket

Implements log/slog.Handler that routes structured log records into the
log-socket broadcasting system. Supports namespaces, WithAttrs,
WithGroup, and configurable minimum level.

Also adds Broadcast() as a public entry point for adapter packages
that construct log.Entry values directly.

* chore: update to Go 1.26, resolve slog LogValuer values
This commit is contained in:
2026-03-01 22:48:12 -05:00
committed by GitHub
parent e725622696
commit 5cb1329155
4 changed files with 320 additions and 3 deletions

2
go.mod
View File

@@ -1,5 +1,5 @@
module github.com/taigrr/log-socket/v2
go 1.25.6
go 1.26.0
require github.com/gorilla/websocket v1.5.3