Documentation
¶
Index ¶
- Constants
- func Close()
- func CollectChildStderr(stderr io.Reader, tags ...any) string
- func Debug(msg string, args ...any)
- func Error(msg string, args ...any)
- func ErrorCtx(ctx context.Context, msg string, args ...any)
- func GetGlobalLogger() *zap.Logger
- func Info(msg string, args ...any)
- func Init(cfg Config)
- func NewLogger(cfg Config) (*zap.Logger, error)
- func SetGlobalLogger(l *zap.Logger)
- func Warn(msg string, args ...any)
- func WarnCtx(ctx context.Context, msg string, args ...any)
- type Config
Constants ¶
const ChildStderrJSONEnv = "INFER_LOG_STDERR_JSON"
ChildStderrJSONEnv is the environment variable the daemon sets on the processes it starts. A child process then logs JSON to stderr and keeps no log file of its own: the daemon collects its stderr into the daemon log.
Variables ¶
This section is empty.
Functions ¶
func CollectChildStderr ¶ added in v0.219.0
CollectChildStderr logs one started child process's stderr into this process's log, one entry per line, enriched with the collector's tags (typically project_dir, conversation_id and worker_pid). It returns once the child's stderr closes, with the last line that was not JSON, which is the child's own plain error when it failed.
func ErrorCtx ¶ added in v0.207.0
ErrorCtx logs an error carrying the OTel trace context of ctx; see WarnCtx.
func GetGlobalLogger ¶
GetGlobalLogger returns the global logger instance Useful for services that need to store a logger reference
func SetGlobalLogger ¶
SetGlobalLogger swaps the global logger (and its sugared form). It is primarily a test seam: tests build a logger over an observed core to assert what was logged. Passing nil is a no-op.