trace

Debugging aid: Output variable name/value and file/line info to stderr.

Also flushes stderr to ensure buffering and a subsequent crash don't cause the message to get lost.

  1. void trace()
    template trace(alias var)
    void
    trace
    (
    string file = __FILE__
    size_t line = __LINE__
    )
    ()
  2. template trace()

Members

Functions

trace
void trace()
Undocumented in source. Be warned that the author may not have intended to support it.

Examples

auto x = 5;
auto str = "Hello";

// Output example:
// src/myproj/myfile.d(42): x: 5
// src/myproj/myfile.d(43): str: Hello
trace!x;
trace!str;

Meta