package debug

import "github.com/google/cel-go/common/debug"

Package debug provides tools to print a parsed expression graph and adorn each expression element with additional metadata.

Index

Functions

func ToAdornedDebugString

func ToAdornedDebugString(e ast.Expr, adorner Adorner) string

ToAdornedDebugString gives the adorned string representation of the Expr.

func ToDebugString

func ToDebugString(e ast.Expr) string

ToDebugString gives the unadorned string representation of the Expr.

Types

type Adorner

type Adorner interface {
	// GetMetadata for the input context.
	GetMetadata(ctx any) string
}

Adorner returns debug metadata that will be tacked on to the string representation of an expression.

type Writer

type Writer interface {
	fmt.Stringer

	// Buffer pushes an expression into an internal queue of expressions to
	// write to a string.
	Buffer(e ast.Expr)
}

Writer manages writing expressions to an internal string.

Source Files

debug.go

Version
v0.25.0 (latest)
Published
Apr 22, 2025
Platform
linux/amd64
Imports
7 packages
Last checked
1 hour ago

Tools for package owners.