use a circular buffer for the debug log. don't build fancy strings out of debug log entries until required.