Documentation
¶
Overview ¶
Package yq centralizes yq's process-global state: its go-logging backend, module log level, and expression parser. It forwards yq's internal diagnostics through the Atmos logger so they inherit Atmos's formatting, configured log destination, and secret masking, instead of yq's own go-logging backend writing straight to stderr, unformatted and unmasked.
Index ¶
Constants ¶
const SilentLevel logging.Level = -1
SilentLevel is lower than go-logging's CRITICAL level, so IsEnabledFor() rejects every message. Exported so callers that always want yq silent (e.g. the YAML editor) share this sentinel instead of each defining their own copy.
Variables ¶
This section is empty.
Functions ¶
func InitExpressionParser ¶
func InitExpressionParser()
InitExpressionParser initializes yq's process-global expression parser exactly once. Yqlib's InitExpressionParser guards yqlib.ExpressionParser with a plain nil check, and every Evaluate call runs it, so concurrent first evaluations would otherwise write and read that global at the same time (#2821). A sync.Once gives later readers a happens-before edge and keeps the one-time cost off commands that never evaluate a yq expression.
func WithEvaluationLevel ¶
WithEvaluationLevel sets yq's logger level and runs fn with that level held fixed for the whole call. Every caller that evaluates a yq expression -- both pkg/utils, whose level depends on Atmos's configured log level, and pkg/yaml's editor, which always wants SilentLevel -- must run its evaluation through this function rather than calling SetLevel and evaluating separately.
Types ¶
This section is empty.