File: log.c

package info (click to toggle)
rtpengine 13.5.1.4-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 13,676 kB
  • sloc: ansic: 86,775; perl: 59,422; python: 3,193; sh: 1,037; makefile: 687; asm: 211
file content (32 lines) | stat: -rw-r--r-- 777 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#include "log.h"
#include <syslog.h>
#include <stdarg.h>
#include <stdio.h>
#include "loglib.h"


__thread const char *log_info_call, *log_info_stream;
__thread unsigned long log_info_ssrc;


void __ilog(int prio, const char *fmt, ...) {
        va_list ap;
	char prefix[300] = "";
	char *pp = prefix;
	char *endp = prefix + sizeof(prefix);

	if (log_info_call)
		pp += snprintf(pp, endp - pp, "[C %s%s%s] ", FMT_M(log_info_call));
	if (log_info_stream)
		pp += snprintf(pp, endp - pp, "[S %s%s%s] ", FMT_M(log_info_stream));
	if (log_info_ssrc)
		pp += snprintf(pp, endp - pp, "[%s0x%lx%s] ", FMT_M(log_info_ssrc));

        va_start(ap, fmt);
        __vpilog(prio, prefix, fmt, ap);
        va_end(ap);
}

int get_local_log_level(unsigned int subsystem_idx) {
	return -1;
}