Vely logo install | documentation | examples | changelog
16.10.0 released May 10, 2023

Purpose: Emit trace.

trace-run [ <format>, <expression> [ , ... ] ]

trace-run formats a tracing message according to the <format> string and a list of variable-type <expression>s (in the same way C's printf() does) and then writes the result into current process' trace_file (if enabled, see vv) without any encoding (meaning a string is output exactly as it is).

trace-run can be used without any clauses, in which case a location (file name and line number) is recorded in the trace file - this is useful when you only want to know if the execution passed through code.

If trace-run has any other clauses, then <format> string must be present and there must be at least one <expression> (it means if you want to trace a simple string literal you still have to use "%s" as format).

For tracing to have effect, debugging and tracing must be enabled (see vv). For location of trace files, see how_vely_works.
// Trace information
trace-run "Program wrote %lld bytes into file %s", num_bytes, file_name

// Trace that program execution passed through here

See example_hello_world for an example in debugging and tracing.
See also
Debugging ( debugging   trace-run  )  SEE ALL (documentation)

Copyright (c) 2017-2023 Dasoftver LLC