Replaced calls to log() with the logger object.