Tweak log function