MCPcopy Create free account
hub / github.com/apple/foundationdb / vlog_process_msg

Function vlog_process_msg

fdbmonitor/fdbmonitor.cpp:148–167  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

146std::string logGroup = "default";
147
148void vlog_process_msg(Severity severity, const char* process, const char* format, va_list args) {
149 if (daemonize) {
150 char buf[4096];
151 int len = vsnprintf(buf, 4096, format, args);
152 syslog(severity_to_priority(severity),
153 "LogGroup=\"%s\" Process=\"%s\": %.*s",
154 logGroup.c_str(),
155 process,
156 len,
157 buf);
158 } else {
159 fprintf(stderr,
160 "Time=\"%.6f\" Severity=\"%d\" LogGroup=\"%s\" Process=\"%s\": ",
161 get_cur_timestamp(),
162 (int)severity,
163 logGroup.c_str(),
164 process);
165 vfprintf(stderr, format, args);
166 }
167}
168
169void log_msg(Severity severity, const char* format, ...) {
170 va_list args;

Callers 2

log_msgFunction · 0.85
log_process_msgFunction · 0.85

Calls 5

severity_to_priorityFunction · 0.85
fprintfFunction · 0.85
get_cur_timestampFunction · 0.85
vfprintfFunction · 0.85
c_strMethod · 0.45

Tested by

no test coverage detected