Fixed a bug: used wrong function name:writeLog

change call function writeData to replace writeLog