Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Log Analysis

Batuta uses the tracing crate for structured logging. Proper log analysis is the fastest way to diagnose most pipeline failures.

RUST_LOG Configuration

# Debug for pipeline module only
RUST_LOG=batuta::pipeline=debug batuta transpile --source ./src

# Combine: debug for pipeline, warn for everything else
RUST_LOG=warn,batuta::pipeline=debug batuta transpile --source ./src

Log Levels

LevelUse ForTypical Volume
errorUnrecoverable failures0-5 per run
warnDegraded behavior, fallbacks5-20 per run
infoPhase transitions, summaries20-50 per run
debugDecision points, intermediate values100-500 per run
tracePer-file, per-function detail1000+ per run

Structured Log Fields

Batuta logs structured fields parseable by aggregation tools:

{"level":"WARN","target":"batuta::pipeline",
 "phase":"transpilation","file":"src/model.py",
 "issue":"ambiguous_type","variable":"weights"}

Filtering

RUST_LOG=info batuta transpile --source ./src 2>&1 | \
    jq 'select(.level == "WARN" and .phase == "transpilation")'

Common Log Patterns

Log PatternMeaningAction
error="no source files"Empty or wrong pathCheck --source
tool_not_found=trueMissing transpilerInstall tool
backend="scalar_fallback"SIMD/GPU unavailableCheck target-cpu
mismatch=trueOutput differsReview trace diff

Redirecting Logs to File

RUST_LOG=debug batuta transpile --source ./src 2> transpile.log
grep "WARN" transpile.log

Navigate: Table of Contents