Added debug flag to prevent string allocation on debug lines that won't be printed