Save to log after each file instead of waiting until destructor is called