implement the log function