On Monday, 17 August 2020 at 22:37:12 UTC, Simen Kjærås wrote:
mixin template ctLog(string msg, string file = __FILE__, size_t line = __LINE__) {
    pragma(msg, file, "(", line, "): ", msg);
}

Thanks.

Forgot to mention that I want to support variadic arguments to `ctLog` similar to what is done with

void dbg(Args...)(Args args,
                  const string file = __FILE_FULL_PATH__,
                  const uint line = __LINE__,
const string fun = __FUNCTION__) @safe pure nothrow @nogc
{
    import std.stdio : stderr, writeln;
    try
debug stderr.writeln(file, "(", line, ",1):", " Debug: \"", args, "\"");
    catch (Exception) { }
}

Is this possible?

Reply via email to