Added log function.