  
  int main() {
    setpriority(PRIO_PROCESS, 0, -15);
  
    ExitHandler do_exit;
    PubMaster pm({"androidLog"});
  
    log_time last_log_time = {};
    logger_list *logger_list = android_logger_list_alloc(ANDROID_LOG_RDONLY | ANDROID_LOG_NONBLOCK, 0, 0);
  
    while (!do_exit) {
      // setup android logging
      if (!logger_list) {
        logger_list = android_logger_list_alloc_time(ANDROID_LOG_RDONLY | ANDROID_LOG_NONBLOCK, last_log_time, 0);
      }
      assert(logger_list);
  
      struct logger *main_logger = android_logger_open(logger_list, LOG_ID_MAIN);
      assert(main_logger);
      struct logger *radio_logger = android_logger_open(logger_list, LOG_ID_RADIO);
      assert(radio_logger);
      struct logger *system_logger = android_logger_open(logger_list, LOG_ID_SYSTEM);
      assert(system_logger);
      struct logger *crash_logger = android_logger_open(logger_list, LOG_ID_CRASH);
      assert(crash_logger);
      struct logger *kernel_logger = android_logger_open(logger_list, (log_id_t)5); // LOG_ID_KERNEL
      assert(kernel_logger);
  
      while (!do_exit) {
        log_msg log_msg;
        int err = android_logger_list_read(logger_list, &log_msg);
        if (err <= 0) break;
  
        AndroidLogEntry entry;
        err = android_log_processLogBuffer(&log_msg.entry_v1, &entry);
        if (err < 0) continue;
        last_log_time.tv_sec = entry.tv_sec;
        last_log_time.tv_nsec = entry.tv_nsec;
  
        MessageBuilder msg;
        auto androidEntry = msg.initEvent().initAndroidLog();
        androidEntry.setId(log_msg.id());
        androidEntry.setTs(entry.tv_sec * 1000000000ULL + entry.tv_nsec);
        androidEntry.setPriority(entry.priority);
        androidEntry.setPid(entry.pid);
        androidEntry.setTid(entry.tid);
        androidEntry.setTag(entry.tag);
        androidEntry.setMessage(entry.message);
  
        pm.send("androidLog", msg);
      }
  
      android_logger_list_free(logger_list);
      logger_list = NULL;
      util::sleep_for(500);
    }
  
    if (logger_list) {
      android_logger_list_free(logger_list);
    }
 
</s> remove   if (logger_list) {
    android_logger_list_free(logger_list);
 </s> add   PubMaster pm({"androidLog"});

  while (true) {
    log_msg log_msg;
    int err = android_logger_list_read(logger_list, &log_msg);
    if (err <= 0) break;

    AndroidLogEntry entry;
    err = android_log_processLogBuffer(&log_msg.entry_v1, &entry);
    if (err < 0) continue;

    MessageBuilder msg;
    auto androidEntry = msg.initEvent().initAndroidLog();
    androidEntry.setId(log_msg.id());
    androidEntry.setTs(entry.tv_sec * NS_PER_SEC + entry.tv_nsec);
    androidEntry.setPriority(entry.priority);
    androidEntry.setPid(entry.pid);
    androidEntry.setTid(entry.tid);
    androidEntry.setTag(entry.tag);
    androidEntry.setMessage(entry.message);
    pm.send("androidLog", msg); </s> remove #include "selfdrive/common/util.h"
 </s> add #undef LOG_ID_KERNEL
#define LOG_ID_KERNEL 5 </s> remove       sent_msgs = {}
 </s> add 
  // setup android logging
  logger_list *logger_list = android_logger_list_alloc(ANDROID_LOG_RDONLY, 0, 0);
  assert(logger_list);
  for (auto log_id : {LOG_ID_MAIN, LOG_ID_RADIO, LOG_ID_SYSTEM, LOG_ID_CRASH, (log_id_t)LOG_ID_KERNEL}) {
    logger *logger = android_logger_open(logger_list, log_id);
    assert(logger);
  
  int main() {
    setpriority(PRIO_PROCESS, 0, -15);
  
  // setup android logging
  logger_list *logger_list = android_logger_list_alloc(ANDROID_LOG_RDONLY, 0, 0);
  assert(logger_list);
  for (auto log_id : {LOG_ID_MAIN, LOG_ID_RADIO, LOG_ID_SYSTEM, LOG_ID_CRASH, (log_id_t)LOG_ID_KERNEL}) {
    logger *logger = android_logger_open(logger_list, log_id);
    assert(logger);
  // setup android logging
  logger_list *logger_list = android_logger_list_alloc(ANDROID_LOG_RDONLY, 0, 0);
  assert(logger_list);
  for (auto log_id : {LOG_ID_MAIN, LOG_ID_RADIO, LOG_ID_SYSTEM, LOG_ID_CRASH, (log_id_t)LOG_ID_KERNEL}) {
    logger *logger = android_logger_open(logger_list, log_id);
    assert(logger);
  // setup android logging
  logger_list *logger_list = android_logger_list_alloc(ANDROID_LOG_RDONLY, 0, 0);
  assert(logger_list);
  for (auto log_id : {LOG_ID_MAIN, LOG_ID_RADIO, LOG_ID_SYSTEM, LOG_ID_CRASH, (log_id_t)LOG_ID_KERNEL}) {
    logger *logger = android_logger_open(logger_list, log_id);
    assert(logger);
  // setup android logging
  logger_list *logger_list = android_logger_list_alloc(ANDROID_LOG_RDONLY, 0, 0);
  assert(logger_list);
  for (auto log_id : {LOG_ID_MAIN, LOG_ID_RADIO, LOG_ID_SYSTEM, LOG_ID_CRASH, (log_id_t)LOG_ID_KERNEL}) {
    logger *logger = android_logger_open(logger_list, log_id);
    assert(logger);
  // setup android logging
  logger_list *logger_list = android_logger_list_alloc(ANDROID_LOG_RDONLY, 0, 0);
  assert(logger_list);
  for (auto log_id : {LOG_ID_MAIN, LOG_ID_RADIO, LOG_ID_SYSTEM, LOG_ID_CRASH, (log_id_t)LOG_ID_KERNEL}) {
    logger *logger = android_logger_open(logger_list, log_id);
    assert(logger);
  // setup android logging
  logger_list *logger_list = android_logger_list_alloc(ANDROID_LOG_RDONLY, 0, 0);
  assert(logger_list);
  for (auto log_id : {LOG_ID_MAIN, LOG_ID_RADIO, LOG_ID_SYSTEM, LOG_ID_CRASH, (log_id_t)LOG_ID_KERNEL}) {
    logger *logger = android_logger_open(logger_list, log_id);
    assert(logger);
  // setup android logging
  logger_list *logger_list = android_logger_list_alloc(ANDROID_LOG_RDONLY, 0, 0);
  assert(logger_list);
  for (auto log_id : {LOG_ID_MAIN, LOG_ID_RADIO, LOG_ID_SYSTEM, LOG_ID_CRASH, (log_id_t)LOG_ID_KERNEL}) {
    logger *logger = android_logger_open(logger_list, log_id);
    assert(logger);
  // setup android logging
  logger_list *logger_list = android_logger_list_alloc(ANDROID_LOG_RDONLY, 0, 0);
  assert(logger_list);
  for (auto log_id : {LOG_ID_MAIN, LOG_ID_RADIO, LOG_ID_SYSTEM, LOG_ID_CRASH, (log_id_t)LOG_ID_KERNEL}) {
    logger *logger = android_logger_open(logger_list, log_id);
    assert(logger);
  // setup android logging
  logger_list *logger_list = android_logger_list_alloc(ANDROID_LOG_RDONLY, 0, 0);
  assert(logger_list);
  for (auto log_id : {LOG_ID_MAIN, LOG_ID_RADIO, LOG_ID_SYSTEM, LOG_ID_CRASH, (log_id_t)LOG_ID_KERNEL}) {
    logger *logger = android_logger_open(logger_list, log_id);
    assert(logger);
  // setup android logging
  logger_list *logger_list = android_logger_list_alloc(ANDROID_LOG_RDONLY, 0, 0);
  assert(logger_list);
  for (auto log_id : {LOG_ID_MAIN, LOG_ID_RADIO, LOG_ID_SYSTEM, LOG_ID_CRASH, (log_id_t)LOG_ID_KERNEL}) {
    logger *logger = android_logger_open(logger_list, log_id);
    assert(logger);
  // setup android logging
  logger_list *logger_list = android_logger_list_alloc(ANDROID_LOG_RDONLY, 0, 0);
  assert(logger_list);
  for (auto log_id : {LOG_ID_MAIN, LOG_ID_RADIO, LOG_ID_SYSTEM, LOG_ID_CRASH, (log_id_t)LOG_ID_KERNEL}) {
    logger *logger = android_logger_open(logger_list, log_id);
    assert(logger);
  // setup android logging
  logger_list *logger_list = android_logger_list_alloc(ANDROID_LOG_RDONLY, 0, 0);
  assert(logger_list);
  for (auto log_id : {LOG_ID_MAIN, LOG_ID_RADIO, LOG_ID_SYSTEM, LOG_ID_CRASH, (log_id_t)LOG_ID_KERNEL}) {
    logger *logger = android_logger_open(logger_list, log_id);
    assert(logger);
  // setup android logging
  logger_list *logger_list = android_logger_list_alloc(ANDROID_LOG_RDONLY, 0, 0);
  assert(logger_list);
  for (auto log_id : {LOG_ID_MAIN, LOG_ID_RADIO, LOG_ID_SYSTEM, LOG_ID_CRASH, (log_id_t)LOG_ID_KERNEL}) {
    logger *logger = android_logger_open(logger_list, log_id);
    assert(logger);
  // setup android logging
  logger_list *logger_list = android_logger_list_alloc(ANDROID_LOG_RDONLY, 0, 0);
  assert(logger_list);
  for (auto log_id : {LOG_ID_MAIN, LOG_ID_RADIO, LOG_ID_SYSTEM, LOG_ID_CRASH, (log_id_t)LOG_ID_KERNEL}) {
    logger *logger = android_logger_open(logger_list, log_id);
    assert(logger);
  // setup android logging
  logger_list *logger_list = android_logger_list_alloc(ANDROID_LOG_RDONLY, 0, 0);
  assert(logger_list);
  for (auto log_id : {LOG_ID_MAIN, LOG_ID_RADIO, LOG_ID_SYSTEM, LOG_ID_CRASH, (log_id_t)LOG_ID_KERNEL}) {
    logger *logger = android_logger_open(logger_list, log_id);
    assert(logger);
  // setup android logging
  logger_list *logger_list = android_logger_list_alloc(ANDROID_LOG_RDONLY, 0, 0);
  assert(logger_list);
  for (auto log_id : {LOG_ID_MAIN, LOG_ID_RADIO, LOG_ID_SYSTEM, LOG_ID_CRASH, (log_id_t)LOG_ID_KERNEL}) {
    logger *logger = android_logger_open(logger_list, log_id);
    assert(logger);
  // setup android logging
  logger_list *logger_list = android_logger_list_alloc(ANDROID_LOG_RDONLY, 0, 0);
  assert(logger_list);
  for (auto log_id : {LOG_ID_MAIN, LOG_ID_RADIO, LOG_ID_SYSTEM, LOG_ID_CRASH, (log_id_t)LOG_ID_KERNEL}) {
    logger *logger = android_logger_open(logger_list, log_id);
    assert(logger);
  // setup android logging
  logger_list *logger_list = android_logger_list_alloc(ANDROID_LOG_RDONLY, 0, 0);
  assert(logger_list);
  for (auto log_id : {LOG_ID_MAIN, LOG_ID_RADIO, LOG_ID_SYSTEM, LOG_ID_CRASH, (log_id_t)LOG_ID_KERNEL}) {
    logger *logger = android_logger_open(logger_list, log_id);
    assert(logger);
  // setup android logging
  logger_list *logger_list = android_logger_list_alloc(ANDROID_LOG_RDONLY, 0, 0);
  assert(logger_list);
  for (auto log_id : {LOG_ID_MAIN, LOG_ID_RADIO, LOG_ID_SYSTEM, LOG_ID_CRASH, (log_id_t)LOG_ID_KERNEL}) {
    logger *logger = android_logger_open(logger_list, log_id);
    assert(logger);
  // setup android logging
  logger_list *logger_list = android_logger_list_alloc(ANDROID_LOG_RDONLY, 0, 0);
  assert(logger_list);
  for (auto log_id : {LOG_ID_MAIN, LOG_ID_RADIO, LOG_ID_SYSTEM, LOG_ID_CRASH, (log_id_t)LOG_ID_KERNEL}) {
    logger *logger = android_logger_open(logger_list, log_id);
    assert(logger);
  // setup android logging
  logger_list *logger_list = android_logger_list_alloc(ANDROID_LOG_RDONLY, 0, 0);
  assert(logger_list);
  for (auto log_id : {LOG_ID_MAIN, LOG_ID_RADIO, LOG_ID_SYSTEM, LOG_ID_CRASH, (log_id_t)LOG_ID_KERNEL}) {
    logger *logger = android_logger_open(logger_list, log_id);
    assert(logger);
  // setup android logging
  logger_list *logger_list = android_logger_list_alloc(ANDROID_LOG_RDONLY, 0, 0);
  assert(logger_list);
  for (auto log_id : {LOG_ID_MAIN, LOG_ID_RADIO, LOG_ID_SYSTEM, LOG_ID_CRASH, (log_id_t)LOG_ID_KERNEL}) {
    logger *logger = android_logger_open(logger_list, log_id);
    assert(logger);
  // setup android logging
  logger_list *logger_list = android_logger_list_alloc(ANDROID_LOG_RDONLY, 0, 0);
  assert(logger_list);
  for (auto log_id : {LOG_ID_MAIN, LOG_ID_RADIO, LOG_ID_SYSTEM, LOG_ID_CRASH, (log_id_t)LOG_ID_KERNEL}) {
    logger *logger = android_logger_open(logger_list, log_id);
    assert(logger);
  // setup android logging
  logger_list *logger_list = android_logger_list_alloc(ANDROID_LOG_RDONLY, 0, 0);
  assert(logger_list);
  for (auto log_id : {LOG_ID_MAIN, LOG_ID_RADIO, LOG_ID_SYSTEM, LOG_ID_CRASH, (log_id_t)LOG_ID_KERNEL}) {
    logger *logger = android_logger_open(logger_list, log_id);
    assert(logger);
  // setup android logging
  logger_list *logger_list = android_logger_list_alloc(ANDROID_LOG_RDONLY, 0, 0);
  assert(logger_list);
  for (auto log_id : {LOG_ID_MAIN, LOG_ID_RADIO, LOG_ID_SYSTEM, LOG_ID_CRASH, (log_id_t)LOG_ID_KERNEL}) {
    logger *logger = android_logger_open(logger_list, log_id);
    assert(logger);
  // setup android logging
  logger_list *logger_list = android_logger_list_alloc(ANDROID_LOG_RDONLY, 0, 0);
  assert(logger_list);
  for (auto log_id : {LOG_ID_MAIN, LOG_ID_RADIO, LOG_ID_SYSTEM, LOG_ID_CRASH, (log_id_t)LOG_ID_KERNEL}) {
    logger *logger = android_logger_open(logger_list, log_id);
    assert(logger);
  // setup android logging
  logger_list *logger_list = android_logger_list_alloc(ANDROID_LOG_RDONLY, 0, 0);
  assert(logger_list);
  for (auto log_id : {LOG_ID_MAIN, LOG_ID_RADIO, LOG_ID_SYSTEM, LOG_ID_CRASH, (log_id_t)LOG_ID_KERNEL}) {
    logger *logger = android_logger_open(logger_list, log_id);
    assert(logger);
  // setup android logging
  logger_list *logger_list = android_logger_list_alloc(ANDROID_LOG_RDONLY, 0, 0);
  assert(logger_list);
  for (auto log_id : {LOG_ID_MAIN, LOG_ID_RADIO, LOG_ID_SYSTEM, LOG_ID_CRASH, (log_id_t)LOG_ID_KERNEL}) {
    logger *logger = android_logger_open(logger_list, log_id);
    assert(logger);
  // setup android logging
  logger_list *logger_list = android_logger_list_alloc(ANDROID_LOG_RDONLY, 0, 0);
  assert(logger_list);
  for (auto log_id : {LOG_ID_MAIN, LOG_ID_RADIO, LOG_ID_SYSTEM, LOG_ID_CRASH, (log_id_t)LOG_ID_KERNEL}) {
    logger *logger = android_logger_open(logger_list, log_id);
    assert(logger);
  // setup android logging
  logger_list *logger_list = android_logger_list_alloc(ANDROID_LOG_RDONLY, 0, 0);
  assert(logger_list);
  for (auto log_id : {LOG_ID_MAIN, LOG_ID_RADIO, LOG_ID_SYSTEM, LOG_ID_CRASH, (log_id_t)LOG_ID_KERNEL}) {
    logger *logger = android_logger_open(logger_list, log_id);
    assert(logger);
  // setup android logging
  logger_list *logger_list = android_logger_list_alloc(ANDROID_LOG_RDONLY, 0, 0);
  assert(logger_list);
  for (auto log_id : {LOG_ID_MAIN, LOG_ID_RADIO, LOG_ID_SYSTEM, LOG_ID_CRASH, (log_id_t)LOG_ID_KERNEL}) {
    logger *logger = android_logger_open(logger_list, log_id);
    assert(logger);
  // setup android logging
  logger_list *logger_list = android_logger_list_alloc(ANDROID_LOG_RDONLY, 0, 0);
  assert(logger_list);
  for (auto log_id : {LOG_ID_MAIN, LOG_ID_RADIO, LOG_ID_SYSTEM, LOG_ID_CRASH, (log_id_t)LOG_ID_KERNEL}) {
    logger *logger = android_logger_open(logger_list, log_id);
    assert(logger);
  // setup android logging
  logger_list *logger_list = android_logger_list_alloc(ANDROID_LOG_RDONLY, 0, 0);
  assert(logger_list);
  for (auto log_id : {LOG_ID_MAIN, LOG_ID_RADIO, LOG_ID_SYSTEM, LOG_ID_CRASH, (log_id_t)LOG_ID_KERNEL}) {
    logger *logger = android_logger_open(logger_list, log_id);
    assert(logger);
  // setup android logging
  logger_list *logger_list = android_logger_list_alloc(ANDROID_LOG_RDONLY, 0, 0);
  assert(logger_list);
  for (auto log_id : {LOG_ID_MAIN, LOG_ID_RADIO, LOG_ID_SYSTEM, LOG_ID_CRASH, (log_id_t)LOG_ID_KERNEL}) {
    logger *logger = android_logger_open(logger_list, log_id);
    assert(logger);
  // setup android logging
  logger_list *logger_list = android_logger_list_alloc(ANDROID_LOG_RDONLY, 0, 0);
  assert(logger_list);
  for (auto log_id : {LOG_ID_MAIN, LOG_ID_RADIO, LOG_ID_SYSTEM, LOG_ID_CRASH, (log_id_t)LOG_ID_KERNEL}) {
    logger *logger = android_logger_open(logger_list, log_id);
    assert(logger);
  // setup android logging
  logger_list *logger_list = android_logger_list_alloc(ANDROID_LOG_RDONLY, 0, 0);
  assert(logger_list);
  for (auto log_id : {LOG_ID_MAIN, LOG_ID_RADIO, LOG_ID_SYSTEM, LOG_ID_CRASH, (log_id_t)LOG_ID_KERNEL}) {
    logger *logger = android_logger_open(logger_list, log_id);
    assert(logger);
  // setup android logging
  logger_list *logger_list = android_logger_list_alloc(ANDROID_LOG_RDONLY, 0, 0);
  assert(logger_list);
  for (auto log_id : {LOG_ID_MAIN, LOG_ID_RADIO, LOG_ID_SYSTEM, LOG_ID_CRASH, (log_id_t)LOG_ID_KERNEL}) {
    logger *logger = android_logger_open(logger_list, log_id);
    assert(logger);
  // setup android logging
  logger_list *logger_list = android_logger_list_alloc(ANDROID_LOG_RDONLY, 0, 0);
  assert(logger_list);
  for (auto log_id : {LOG_ID_MAIN, LOG_ID_RADIO, LOG_ID_SYSTEM, LOG_ID_CRASH, (log_id_t)LOG_ID_KERNEL}) {
    logger *logger = android_logger_open(logger_list, log_id);
    assert(logger);
  // setup android logging
  logger_list *logger_list = android_logger_list_alloc(ANDROID_LOG_RDONLY, 0, 0);
  assert(logger_list);
  for (auto log_id : {LOG_ID_MAIN, LOG_ID_RADIO, LOG_ID_SYSTEM, LOG_ID_CRASH, (log_id_t)LOG_ID_KERNEL}) {
    logger *logger = android_logger_open(logger_list, log_id);
    assert(logger);
  // setup android logging
  logger_list *logger_list = android_logger_list_alloc(ANDROID_LOG_RDONLY, 0, 0);
  assert(logger_list);
  for (auto log_id : {LOG_ID_MAIN, LOG_ID_RADIO, LOG_ID_SYSTEM, LOG_ID_CRASH, (log_id_t)LOG_ID_KERNEL}) {
    logger *logger = android_logger_open(logger_list, log_id);
    assert(logger);
  // setup android logging
  logger_list *logger_list = android_logger_list_alloc(ANDROID_LOG_RDONLY, 0, 0);
  assert(logger_list);
  for (auto log_id : {LOG_ID_MAIN, LOG_ID_RADIO, LOG_ID_SYSTEM, LOG_ID_CRASH, (log_id_t)LOG_ID_KERNEL}) {
    logger *logger = android_logger_open(logger_list, log_id);
    assert(logger);
  // setup android logging
  logger_list *logger_list = android_logger_list_alloc(ANDROID_LOG_RDONLY, 0, 0);
  assert(logger_list);
  for (auto log_id : {LOG_ID_MAIN, LOG_ID_RADIO, LOG_ID_SYSTEM, LOG_ID_CRASH, (log_id_t)LOG_ID_KERNEL}) {
    logger *logger = android_logger_open(logger_list, log_id);
    assert(logger);
  // setup android logging
  logger_list *logger_list = android_logger_list_alloc(ANDROID_LOG_RDONLY, 0, 0);
  assert(logger_list);
  for (auto log_id : {LOG_ID_MAIN, LOG_ID_RADIO, LOG_ID_SYSTEM, LOG_ID_CRASH, (log_id_t)LOG_ID_KERNEL}) {
    logger *logger = android_logger_open(logger_list, log_id);
    assert(logger);
  // setup android logging
  logger_list *logger_list = android_logger_list_alloc(ANDROID_LOG_RDONLY, 0, 0);
  assert(logger_list);
  for (auto log_id : {LOG_ID_MAIN, LOG_ID_RADIO, LOG_ID_SYSTEM, LOG_ID_CRASH, (log_id_t)LOG_ID_KERNEL}) {
    logger *logger = android_logger_open(logger_list, log_id);
    assert(logger);
  // setup android logging
  logger_list *logger_list = android_logger_list_alloc(ANDROID_LOG_RDONLY, 0, 0);
  assert(logger_list);
  for (auto log_id : {LOG_ID_MAIN, LOG_ID_RADIO, LOG_ID_SYSTEM, LOG_ID_CRASH, (log_id_t)LOG_ID_KERNEL}) {
    logger *logger = android_logger_open(logger_list, log_id);
    assert(logger);
  // setup android logging
  logger_list *logger_list = android_logger_list_alloc(ANDROID_LOG_RDONLY, 0, 0);
  assert(logger_list);
  for (auto log_id : {LOG_ID_MAIN, LOG_ID_RADIO, LOG_ID_SYSTEM, LOG_ID_CRASH, (log_id_t)LOG_ID_KERNEL}) {
    logger *logger = android_logger_open(logger_list, log_id);
    assert(logger);
  // setup android logging
  logger_list *logger_list = android_logger_list_alloc(ANDROID_LOG_RDONLY, 0, 0);
  assert(logger_list);
  for (auto log_id : {LOG_ID_MAIN, LOG_ID_RADIO, LOG_ID_SYSTEM, LOG_ID_CRASH, (log_id_t)LOG_ID_KERNEL}) {
    logger *logger = android_logger_open(logger_list, log_id);
    assert(logger);
  // setup android logging
  logger_list *logger_list = android_logger_list_alloc(ANDROID_LOG_RDONLY, 0, 0);
  assert(logger_list);
  for (auto log_id : {LOG_ID_MAIN, LOG_ID_RADIO, LOG_ID_SYSTEM, LOG_ID_CRASH, (log_id_t)LOG_ID_KERNEL}) {
    logger *logger = android_logger_open(logger_list, log_id);
    assert(logger);
  // setup android logging
  logger_list *logger_list = android_logger_list_alloc(ANDROID_LOG_RDONLY, 0, 0);
  assert(logger_list);
  for (auto log_id : {LOG_ID_MAIN, LOG_ID_RADIO, LOG_ID_SYSTEM, LOG_ID_CRASH, (log_id_t)LOG_ID_KERNEL}) {
    logger *logger = android_logger_open(logger_list, log_id);
    assert(logger);
  // setup android logging
  logger_list *logger_list = android_logger_list_alloc(ANDROID_LOG_RDONLY, 0, 0);
  assert(logger_list);
  for (auto log_id : {LOG_ID_MAIN, LOG_ID_RADIO, LOG_ID_SYSTEM, LOG_ID_CRASH, (log_id_t)LOG_ID_KERNEL}) {
    logger *logger = android_logger_open(logger_list, log_id);
    assert(logger);
  // setup android logging
  logger_list *logger_list = android_logger_list_alloc(ANDROID_LOG_RDONLY, 0, 0);
  assert(logger_list);
  for (auto log_id : {LOG_ID_MAIN, LOG_ID_RADIO, LOG_ID_SYSTEM, LOG_ID_CRASH, (log_id_t)LOG_ID_KERNEL}) {
    logger *logger = android_logger_open(logger_list, log_id);
    assert(logger);
    }
  
    if (logger_list) {
      android_logger_list_free(logger_list);
    }
keep keep keep keep replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace keep keep keep keep keep
 logcatd_android.cc: fix repeating the same messages (#23713)

* fix repeating the same message

* cleanup

* use blocking mode

* check duplicate msg in test 
selfdrive/logcatd/logcatd_android.cc