headscale/hscontrol
Kristoffer Dalby 4f8724151e hscontrol/poll: use sub-logger pattern for mapSession
Replace the helper functions (logf, infof, tracef, errf) with a
zerolog sub-logger initialized in newMapSession(). The sub-logger
is pre-populated with session context (component, node, omitPeers,
stream) eliminating repeated field calls throughout the code.

Changes:
- Add log field to mapSession struct
- Initialize sub-logger with EmbedObject(node) and request context
- Remove logf/infof/tracef/errf helper functions
- Update all callers to use m.log.Level().Caller()... pattern
- Update noise.go to use sess.log instead of sess.tracef

This reduces code by ~20 lines and eliminates ~15 repeated field
calls per log statement.
2026-02-06 07:40:29 +01:00
..
assets editorconfig: add basic editor config 2025-12-16 10:12:36 +01:00
capver capver: generate 2025-12-18 10:02:23 +01:00
db hscontrol: use EmbedObject for node logging 2026-02-06 07:40:29 +01:00
derp derp: migrate to derpserver package API 2026-01-21 19:17:10 +00:00
dns integration: replace time.Sleep with assert.EventuallyWithT (#2680) 2025-07-10 23:38:55 +02:00
mapper hscontrol: use EmbedObject for node logging 2026-02-06 07:40:29 +01:00
policy hscontrol: use EmbedObject for node logging 2026-02-06 07:40:29 +01:00
routes debug: add json and improve 2025-09-09 09:40:00 +02:00
state hscontrol: use EmbedObject for node logging 2026-02-06 07:40:29 +01:00
templates Link to headscale.net for docs 2026-01-16 14:54:04 +01:00
types types: add MarshalZerologObject to domain types 2026-02-06 07:40:29 +01:00
util zlog: add utility package for safe and consistent logging 2026-02-06 07:40:29 +01:00
app.go hscontrol: use EmbedObject for node logging 2026-02-06 07:40:29 +01:00
auth.go hscontrol: use EmbedObject for node logging 2026-02-06 07:40:29 +01:00
auth_tags_test.go state: fix expiry handling during node tag conversion 2026-02-04 15:44:55 +01:00
auth_test.go integration: add test for tagged→user-owned conversion panic 2026-02-04 15:44:55 +01:00
debug.go lint and leftover 2025-09-09 09:40:00 +02:00
grpcv1.go hscontrol: use EmbedObject for node logging 2026-02-06 07:40:29 +01:00
grpcv1_test.go grpc: support expire/delete API keys by ID 2026-01-20 17:13:38 +01:00
handlers.go all: remove deadcode (#2952) 2025-12-10 15:55:15 +01:00
metrics.go all: remove deadcode (#2952) 2025-12-10 15:55:15 +01:00
noise.go hscontrol/poll: use sub-logger pattern for mapSession 2026-02-06 07:40:29 +01:00
oidc.go oidc: make email verification configurable 2025-12-18 11:42:32 +00:00
oidc_template_test.go make tags first class node owner (#2885) 2025-12-02 12:01:25 +01:00
oidc_test.go oidc: make email verification configurable 2025-12-18 11:42:32 +00:00
platform_config.go Return better web errors to the user (#2398) 2025-02-01 15:25:18 +01:00
poll.go hscontrol/poll: use sub-logger pattern for mapSession 2026-02-06 07:40:29 +01:00
tailsql.go integration: replace time.Sleep with assert.EventuallyWithT (#2680) 2025-07-10 23:38:55 +02:00
templates_consistency_test.go Link to headscale.net for docs 2026-01-16 14:54:04 +01:00