Logs

Last updated on November 9, 2026

You can record messages during test execution for debugging and traceability.

TofuPilot automatically captures the level, timestamp, line number, and file name for each log entry and records it in the test report.

Debug

You can use log.debug() to log diagnostic information.

def measure_voltage(log, measurements, multimeter):
    log.debug(f"Multimeter: {multimeter.identify()}") 
    voltage = multimeter.read_voltage()
    measurements.voltage = voltage

You can use debug logs to record low-level details like device addresses, raw data, or internal state that help troubleshoot issues during development.

Info

You can use log.info() to log informational messages, or use print().

def measure_voltage(log, measurements, multimeter):
    log.info("Starting voltage measurement") 
    voltage = multimeter.read_voltage()
    measurements.voltage = voltage

You can use info logs to track key milestones, record operation starts, or document normal behavior.

Warning

You can use log.warning() to log warnings, or use sys.stderr.write().

def measure_voltage(log, measurements, multimeter):
    voltage = multimeter.read_voltage()
    log.warning("Voltage reading took longer than expected") 
    measurements.voltage = voltage

You can use warning logs to flag unexpected behavior, slow operations, or edge cases that don't cause test failure but need attention.

Error

You can use log.error() to log errors. Logged errors do not affect the phase outcome, only thrown errors do.

def measure_voltage(phase, log, measurements, multimeter):
    if not multimeter.is_connected(): 
        log.error("Multimeter connection lost") 
        phase.fail() 
        return

    voltage = multimeter.read_voltage()
    measurements.voltage = voltage

You can use error logs to record critical failures like connection loss, invalid responses, or conditions that cause the test to fail.

Verbosity

tofupilot run shows a line by its level and by who wrote it: your procedure (one of its files, code it shares with other procedures, or a print()) or a library installed in its environment (an instrument driver, an HTTP client). Add -v to see more.

LevelYour procedureA library
WARNING, ERRORShownShown
INFOShownWith -v
DEBUGWith -vNot shown

The operator UI and the --json stream show the same lines as the terminal. A station always runs at the default level.

How is this guide?

On this page