Checking logging level before logging proto record creation