Commit 70a0e732 authored by Gautier Pelloux-Prayer's avatar Gautier Pelloux-Prayer
Browse files

belle_sip_utils.c: log fatal messages to strerr before abort

parent 16ae1b7f
......@@ -263,6 +263,11 @@ static void __belle_sip_logv_out(belle_sip_log_level lev, const char *fmt, va_li
#endif
fprintf(__log_file,"%i-%.2i-%.2i %.2i:%.2i:%.2i:%.3i belle-sip-%s-%s" ENDLINE,1900+lt->tm_year,lt->tm_mon+1,lt->tm_mday,lt->tm_hour,lt->tm_min,lt->tm_sec,(int)(tp.tv_usec/1000), lname,msg);
fflush(__log_file);
// fatal messages should go to stderr too, even if we are using a file since application will abort right after
if (__log_file != stderr && lev == BELLE_SIP_LOG_FATAL) {
fprintf(stderr,"%i-%.2i-%.2i %.2i:%.2i:%.2i:%.3i belle-sip-%s-%s" ENDLINE,1900+lt->tm_year,lt->tm_mon+1,lt->tm_mday,lt->tm_hour,lt->tm_min,lt->tm_sec,(int)(tp.tv_usec/1000), lname,msg);
fflush(stderr);
}
free(msg);
}
......
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