Don't accidentally sleep negative duration, it causes an IOError.  Clear log when dumping it, so that duplicate entries are not dumped.