  
    s.inited = true;
  }
  
  void log(int levelnum, const char* filename, int lineno, const char* func, const char* msg, const std::string& log_s) {
    std::lock_guard lk(s.lock);
    cloudlog_init();
    if (levelnum >= s.print_level) {
      printf("%s: %s\n", filename, msg);
    }
    char levelnum_c = levelnum;
    zmq_send(s.sock, (levelnum_c + log_s).c_str(), log_s.length() + 1, ZMQ_NOBLOCK);
 
</s> remove   vasprintf(&msg_buf, fmt, args);
 </s> add   int ret = vasprintf(&msg_buf, fmt, args); </s> remove   if (!msg_buf) return;
 </s> add   if (ret <= 0 || !msg_buf) return;

  std::lock_guard lk(s.lock);
  cloudlog_init();
static void log(int levelnum, const char* filename, int lineno, const char* func, const char* msg, const std::string& log_s) {
  
    s.inited = true;
  }
  
static void log(int levelnum, const char* filename, int lineno, const char* func, const char* msg, const std::string& log_s) {
static void log(int levelnum, const char* filename, int lineno, const char* func, const char* msg, const std::string& log_s) {
static void log(int levelnum, const char* filename, int lineno, const char* func, const char* msg, const std::string& log_s) {
    if (levelnum >= s.print_level) {
      printf("%s: %s\n", filename, msg);
    }
    char levelnum_c = levelnum;
    zmq_send(s.sock, (levelnum_c + log_s).c_str(), log_s.length() + 1, ZMQ_NOBLOCK);
keep keep keep keep replace replace replace keep keep keep keep keep
 swaglog.cc: add test case. fixed the ctx of the first message is empty (#23226)

* test case

* add to selfdrive_tests.yaml

* fix ctx_j is empty

* check return value too 
selfdrive/common/swaglog.cc