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

Function init_xlog

xlog.c:134–165  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

132
133
134int init_xlog(void)
135{
136 if (log_buf == NULL) {
137 if (buf_init()) {
138 LM_ERR("Cannot print message!\n");
139 return -1;
140 }
141 }
142
143 xlog_level_shared = (int*)shm_malloc(sizeof(int));
144 if (xlog_level_shared==NULL) {
145 LM_ERR("failed to allocate shared holder for xlog\n");
146 return -1;
147 }
148 xlog_level = xlog_level_shared;
149 *xlog_level = xlog_level_default;
150
151 if (register_trace_type)
152 xlog_proto_id = register_trace_type((char *)xlog_id_s);
153
154 memset(&tprot, 0, sizeof(trace_proto_t));
155 if (global_trace_api) {
156 memcpy(&tprot, global_trace_api, sizeof(trace_proto_t));
157 } else {
158 if (trace_prot_bind(XLOG_TRACE_API_MODULE, &tprot)) {
159 LM_DBG("failed to load trace protocol!\n");
160 }
161 }
162
163
164 return 0;
165}
166
167
168static inline void add_xlog_data(trace_message message, void* param)

Callers

nothing calls this directly

Calls 3

buf_initFunction · 0.85
shm_mallocFunction · 0.85
trace_prot_bindFunction · 0.85

Tested by

no test coverage detected