  #include <bzlib.h>
  #include <kj/array.h>
  #include <capnp/serialize.h>
  
  #if defined(QCOM) || defined(QCOM2)
  const std::string LOG_ROOT = "/data/media/0/realdata";
  #else
 
</s> remove #include <cstdio>

#include <bzlib.h>

 </s> add  </s> remove #include "common/util.h"
#include "messaging.hpp"
 </s> add  </s> remove   fclose(file);
 </s> add 
#include "common/util.h"
  #include <bzlib.h>
  #include <kj/array.h>
  #include <capnp/serialize.h>
#include "common/util.h"
  
  #if defined(QCOM) || defined(QCOM2)
  const std::string LOG_ROOT = "/data/media/0/realdata";
  #else
keep keep add keep keep 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/logger.h