Added a log function