tweak log function