Log function added.