Skip to content

Agent logging#355

Open
jenstopp wants to merge 2 commits into
mainfrom
agent-logging
Open

Agent logging#355
jenstopp wants to merge 2 commits into
mainfrom
agent-logging

Conversation

@jenstopp

@jenstopp jenstopp commented Jul 2, 2026

Copy link
Copy Markdown
Member

A coherent logging system and policy for the agent and server.

Also touches on #37

jenstopp added 2 commits July 2, 2026 14:48
Change the module.Module interface to Init(ctx context.Context) /
Deinit(ctx context.Context) and thread an agent-lifetime context through
dutagent.Init/Deinit and (*agent).initModules, so a context reaches every
module's lifecycle hooks. ipmi now uses the passed context for Connect/Close
instead of context.Background().

This is groundwork for structured server logging (logger-in-context) and for
future context use. TODO(ctx) markers flag the seams where deadlines and
cancellation would attach: client unary RPCs, agent registration, and module
startup/shutdown. No behavior change.

Signed-off-by: Jens Topp <jens.topp@blindspot.software>
Add internal/log (log/slog based, logger-in-context) and adopt it across the
dutagent and dutserver services. Each subsystem sets a flat scope, rendered as
a "[scope]" prefix in text output or a "scope" attribute in JSON. A custom text
handler formats compact, human-readable lines with TTY-gated color; -log and
-log-json flags select level and format. Logs are written to stderr.

Modules log from the admin/operator perspective (external interactions and
applied defaults) via the context-carried logger, rather than re-narrating
client output. dutserver stops dumping whole payloads and demotes per-message
forwarding to debug.

Signed-off-by: Jens Topp <jens.topp@blindspot.software>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant