move the process of formatting debug print to formatter