logx

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2026 License: Apache-2.0 Imports: 5 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package logx builds the gateway logger and defines the level policy used in the code.

Level policy:

DEBUG     details useful while diagnosing (CLI arguments, timings of internal steps)
INFO      normal lifecycle events (startup, run started/finished, workspace changes)
WARN      the request or environment is wrong but the gateway is fine
          (auth failure, rejected IP, busy session, insecure setting)
ERROR     an operation failed because of the gateway or the agent CLI
CRITICAL  the gateway cannot keep serving (listener failure, broken startup)

Prompts, answers and credentials are never logged outside the opt-in body log.

Index

Constants

View Source
const (
	FormatJSON = "json"
	FormatText = "text"
	// FormatConsole is colored, human-oriented output for an interactive terminal.
	FormatConsole = "console"
)

Log formats (NATIVE_AGENT_LOG_FORMAT).

View Source
const LevelCritical = slog.Level(12)

LevelCritical is above slog.LevelError; it is rendered as "CRITICAL".

Variables

This section is empty.

Functions

func Critical

func Critical(ctx context.Context, logger *slog.Logger, msg string, args ...any)

Critical logs at LevelCritical.

func Discard

func Discard() *slog.Logger

Discard returns a logger that drops everything (tests, optional dependencies).

func New

func New(w io.Writer, cfg config.Log) *slog.Logger

New returns a JSON or text logger configured from cfg.

func RequestID

func RequestID(ctx context.Context) string

RequestID returns the request ID carried by ctx, or "".

func WithRequestID

func WithRequestID(ctx context.Context, id string) context.Context

WithRequestID returns ctx carrying the HTTP request ID. Every record logged with that context gets a request_id attribute.

Types

This section is empty.

Jump to

Keyboard shortcuts

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