updated logging statements with level check to avoid uneccessary string concatenation.