minor fix log function: erase buffer