Commit fea496a1 authored by jehan's avatar jehan

Make sure log handler is only for belle-sip trace domain

parent 2eee2e30
......@@ -60,7 +60,7 @@ BELLE_SIP_END_DECLS
#define BELLE_SIP_LOG_END BCTBX_LOG_END
#define belle_sip_log_level BctbxLogLevel
#define belle_sip_log_function_t BctoolboxLogFunc
#define belle_sip_log_function_t BctbxLogFunc
typedef enum {
......@@ -105,9 +105,8 @@ BELLE_SIP_BEGIN_DECLS
#endif
#define belle_sip_set_log_file bctbx_set_log_file
#define belle_sip_set_log_handler bctbx_set_log_handler
#define belle_sip_get_log_handler bctbx_get_log_handler
BELLESIP_EXPORT void belle_sip_set_log_handler(belle_sip_log_function_t func);
#define belle_sip_strdup_printf bctbx_strdup_printf
#define belle_sip_strcat_vprintf bctbx_strcat_vprintf
......
......@@ -112,13 +112,14 @@ static void belle_sip_stack_destroy(belle_sip_stack_t *stack){
if (stack->http_proxy_passwd) belle_sip_free(stack->http_proxy_passwd);
if (stack->http_proxy_username) belle_sip_free(stack->http_proxy_username);
belle_sip_list_free_with_data(stack->dns_servers, belle_sip_free);
bctbx_uninit_logger();
}
BELLE_SIP_DECLARE_NO_IMPLEMENTED_INTERFACES(belle_sip_stack_t);
BELLE_SIP_INSTANCIATE_VPTR(belle_sip_stack_t,belle_sip_object_t,belle_sip_stack_destroy,NULL,NULL,FALSE);
belle_sip_stack_t * belle_sip_stack_new(const char *properties){
bctbx_init_logger(FALSE);
belle_sip_stack_t *stack=belle_sip_object_new(belle_sip_stack_t);
stack->ml=belle_sip_main_loop_new ();
stack->timer_config.T1=500;
......@@ -315,3 +316,6 @@ int belle_sip_stack_content_encoding_available(belle_sip_stack_t *stack, const c
GET_SET_STRING(belle_sip_stack,http_proxy_host)
GET_SET_INT(belle_sip_stack,http_proxy_port, int)
void belle_sip_set_log_handler(belle_sip_log_function_t func) {
bctbx_set_log_handler_for_domain(func, BELLE_SIP_LOG_DOMAIN);
}
......@@ -173,7 +173,6 @@ int belle_sip_tester_set_log_file(const char *filename) {
belle_sip_message("Redirecting traces to file [%s]", filename);
filehandler = bctbx_create_file_log_handler(0, dir, base, log_file);
bctbx_add_log_handler(filehandler);
bctbx_add_log_handler(filehandler);
if (dir) bctbx_free(dir);
if (base) bctbx_free(base);
return 0;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment