Complete the implementation of WriteLog().