daemonlog

package
v0.3.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 19, 2026 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Overview

Package daemonlog holds the logger and shutdown handling the dispatcher and executor daemons share, so both report the same way.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Diagnostic

func Diagnostic(err error) string

Diagnostic is bounded, single-line text for the opt-in private Debug sink. Callers redact known credentials before using it; it is not a secret detector.

func Identifier

func Identifier(value string) string

Identifier keeps non-secret identifiers bounded and safe in text logs too. Oversized or non-printable identifiers use a stable digest, not a prefix that could make two different executors appear to be the same one.

func New

func New(level string, jsonLogs bool) *zap.Logger

New builds a daemon logger that writes to stdout without stack traces. It uses zap's development encoding, or its JSON production encoding when jsonLogs is set. A level zap cannot parse falls back to info; the daemons' configuration loaders reject such a level before this is reached.

func RequestID

func RequestID(ctx context.Context) string

func Run

func Run(logger *zap.Logger, role string, run func(context.Context) error) error

Run calls run with a context that SIGINT or SIGTERM cancels. When a signal arrives it logs, once and tagged with role, that shutdown was requested, and it returns only after that notice is written, so the notice always precedes whatever the caller logs about how the daemon stopped.

func RunFields

func RunFields(ctx context.Context, id uuid.UUID, executorID string, binding controlsession.Binding) []zap.Field

RunFields joins HTTP and dispatcher events through request_id, and dispatcher and executor events through the run and control binding. No durable attempt identity is currently available; absence is not evidence of a first attempt.

func SessionFields

func SessionFields(executorID string, binding controlsession.Binding) []zap.Field

func StreamErrors

func StreamErrors(logger *zap.Logger) grpc.StreamServerInterceptor

func UnaryErrors

func UnaryErrors(logger *zap.Logger) grpc.UnaryServerInterceptor

func UploadFailureFields

func UploadFailureFields(ctx context.Context, stage string, err error, elapsed time.Duration) []zap.Field

UploadFailureFields records the boundary that failed, not a guessed root cause or admission outcome. Stage is a constant from the upload handler; error text and request contents must not be included in these normal logs.

func WithRequestID

func WithRequestID(ctx context.Context, id uuid.UUID) context.Context

WithRequestID attaches a server-generated identifier to local request work.

func YamuxConfig

func YamuxConfig(logger *zap.Logger) *yamux.Config

YamuxConfig retains the transport defaults while sending its internal diagnostics to the operator's bounded, opt-in Debug sink instead of stderr. Yamux logs transport errors and frame metadata, never stream payloads.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL