    // Close bz2 and file
    BZ2_bzWriteClose(&bzerror, bz_file, 0, NULL, NULL);
    assert(bzerror == BZ_OK);
  
    fclose(file);
    return 0;
  }
 
</s> remove #include "common/util.h"
#include "messaging.hpp"
 </s> add  </s> remove #include <cstdio>

#include <bzlib.h>

 </s> add 
    // Close bz2 and file
    BZ2_bzWriteClose(&bzerror, bz_file, 0, NULL, NULL);
    assert(bzerror == BZ_OK);
  

    return 0;
  }
keep keep keep keep replace keep keep
 Logger: new class BZFile (#19959)

* add class BZFile

* inline

* cleanup includes

* stack bzfile

* log first error

* remove assert

* rename log_err to err_logged

* assert in destructor

* LOGE

* don't assert statement

* assert error of fclose 
selfdrive/loggerd/bootlog.cc