MCPcopy Create free account
hub / github.com/OpenSIPS/opensips / stderr_dprint

Function stderr_dprint

dprint.c:458–488  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

456}
457
458static void stderr_dprint(int log_level, int facility, const char *module, const char *func,
459 char *format, va_list ap)
460{
461 char *time;
462 int pid;
463 char *prefix;
464 int len;
465 str buf = {log_json_buf, log_json_buf_size};
466
467 if (stderr_log_format != LOG_FORMAT_PLAIN) {
468 time = va_arg(ap, char *);
469 pid = va_arg(ap, int);
470 prefix = va_arg(ap, char *);
471 if (module && func)
472 va_arg(ap, char *);
473
474 if ((len = log_print_json(&buf, stderr_log_format==LOG_FORMAT_JSON_CEE ?
475 LOG_JSON_SCHEMA_CEE : LOG_JSON_SCHEMA_BASIC,
476 time, pid, prefix, dp_log_level_str(log_level), module, func,
477 format, ap)) < 0) {
478 stderr_dprint_tmp_err("failed to print JSON log!\n");
479 return;
480 }
481
482 fprintf(stderr, "%.*s\n", len, log_json_buf);
483 fflush(stderr);
484 } else {
485 vfprintf(stderr,format,ap);
486 fflush(stderr);
487 }
488}
489
490static void syslog_dprint(int log_level, int facility, const char *module, const char *func,
491 char *format, va_list ap)

Callers

nothing calls this directly

Calls 2

log_print_jsonFunction · 0.85
dp_log_level_strFunction · 0.85

Tested by

no test coverage detected