File: log.h

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 (64 lines) | stat: -rw-r--r-- 1,081 bytes parent folder | download
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
#ifndef __LOG_H__
#define __LOG_H__


#include "str.h"
#include "loglib.h"
#include "types.h"



struct ice_agent;
enum log_format;

struct log_info {
	union {
		call_t *call;
		stream_fd *stream_fd;
		const str *str;
		const char *cstr;
		struct ice_agent *ice_agent;
		void *ptr;
	};
	union {
		struct call_media *media;
	};
	enum {
		LOG_INFO_NONE = 0,
		LOG_INFO_CALL,
		LOG_INFO_STREAM_FD,
		LOG_INFO_STR,
		LOG_INFO_C_STRING,
		LOG_INFO_ICE_AGENT,
		LOG_INFO_MEDIA,
	} e;
};

extern int _log_facility_cdr;
extern int _log_facility_rtcp;
extern int _log_facility_dtmf;


#define LOG_INFO_STACK_SIZE 8
extern __thread struct log_info log_info[LOG_INFO_STACK_SIZE];
extern __thread unsigned int log_info_idx;



void cdrlog(const char* cdrbuffer);
void rtcplog(const char* cdrbuffer);
void dtmflog(GString *s);


void log_format(enum log_format);
void __ilog(int prio, const char *fmt, ...) __attribute__ ((format (printf, 2, 3)));

// call debug
#ifdef __DEBUG
#define __C_DBG(x...) ilog(LOG_DEBUG, x)
#else
#define __C_DBG(x...) ilogs(internals, LOG_DEBUG, x)
#endif


#endif