Debugging by old fashioned trace log printfs / writefln

Cecil Ward cecil at cecilward.com
Thu Jun 29 18:27:22 UTC 2023


I’m trying to debug my D program with old-fashioned printfs stuck 
in various strategic places, actually using writefln(). My 
problem is that the addition of printf fights with the existing 
declarations for pure nothrow @nogc @safe and I have to adjust 
them, then put them back correctly when the writefln() trace 
statements are later removed.

Is there something else I could be using, something that is 
allowed to violate the checking rules for purity, nothrow, @nogc? 
Would pragma( msg, "…" ) do the trick? Is that what I should be 
using?


More information about the Digitalmars-d-learn mailing list