Instead, add `debug(string) import core.stdc.stdio;`, then no other changes are necessary.  Changing printf to writeln will have no effect other than decreasing performance slightly and increasing compile time.