Only build string if the log level is debug