Added an autorelease pool.
log only if logEnabled if set to true