swaglog.cc/cloudlog_common: pass json object by reference (#24996)

* pass json object by reference

* space between functions
old-commit-hash: 1ac1fe632f
taco
Dean Lee 3 years ago committed by GitHub
parent c470f85685
commit 31fddf592f
  1. 3
      common/swaglog.cc

@ -66,8 +66,9 @@ static void log(int levelnum, const char* filename, int lineno, const char* func
char levelnum_c = levelnum; char levelnum_c = levelnum;
zmq_send(s.sock, (levelnum_c + log_s).c_str(), log_s.length() + 1, ZMQ_NOBLOCK); zmq_send(s.sock, (levelnum_c + log_s).c_str(), log_s.length() + 1, ZMQ_NOBLOCK);
} }
static void cloudlog_common(int levelnum, const char* filename, int lineno, const char* func, static void cloudlog_common(int levelnum, const char* filename, int lineno, const char* func,
char* msg_buf, json11::Json::object msg_j={}) { char* msg_buf, const json11::Json::object &msg_j={}) {
std::lock_guard lk(s.lock); std::lock_guard lk(s.lock);
if (!s.initialized) s.initialize(); if (!s.initialized) s.initialize();

Loading…
Cancel
Save