| 146 | std::string logGroup = "default"; |
| 147 | |
| 148 | void 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 | |
| 169 | void log_msg(Severity severity, const char* format, ...) { |
| 170 | va_list args; |
no test coverage detected