wrap logger statements in a check to see if debugging is enabled