|
|
@ -1116,6 +1116,7 @@ static void *logger_thread(void *data)
|
|
|
|
AST_LIST_LOCK(&logmsgs);
|
|
|
|
AST_LIST_LOCK(&logmsgs);
|
|
|
|
if (AST_LIST_EMPTY(&logmsgs)) {
|
|
|
|
if (AST_LIST_EMPTY(&logmsgs)) {
|
|
|
|
if (close_logger_thread) {
|
|
|
|
if (close_logger_thread) {
|
|
|
|
|
|
|
|
AST_LIST_UNLOCK(&logmsgs);
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
ast_cond_wait(&logcond, &logmsgs.lock);
|
|
|
|
ast_cond_wait(&logcond, &logmsgs.lock);
|
|
|
@ -1233,8 +1234,6 @@ void close_logger(void)
|
|
|
|
closelog(); /* syslog */
|
|
|
|
closelog(); /* syslog */
|
|
|
|
|
|
|
|
|
|
|
|
AST_RWLIST_UNLOCK(&logchannels);
|
|
|
|
AST_RWLIST_UNLOCK(&logchannels);
|
|
|
|
|
|
|
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
struct ast_callid *ast_create_callid(void)
|
|
|
|
struct ast_callid *ast_create_callid(void)
|
|
|
@ -1379,15 +1378,18 @@ static void __attribute__((format(printf, 6, 0))) ast_log_full(int level, const
|
|
|
|
/* If the logger thread is active, append it to the tail end of the list - otherwise skip that step */
|
|
|
|
/* If the logger thread is active, append it to the tail end of the list - otherwise skip that step */
|
|
|
|
if (logthread != AST_PTHREADT_NULL) {
|
|
|
|
if (logthread != AST_PTHREADT_NULL) {
|
|
|
|
AST_LIST_LOCK(&logmsgs);
|
|
|
|
AST_LIST_LOCK(&logmsgs);
|
|
|
|
|
|
|
|
if (close_logger_thread) {
|
|
|
|
|
|
|
|
/* Logger is either closing or closed. We cannot log this message. */
|
|
|
|
|
|
|
|
ast_free(logmsg);
|
|
|
|
|
|
|
|
} else {
|
|
|
|
AST_LIST_INSERT_TAIL(&logmsgs, logmsg, list);
|
|
|
|
AST_LIST_INSERT_TAIL(&logmsgs, logmsg, list);
|
|
|
|
ast_cond_signal(&logcond);
|
|
|
|
ast_cond_signal(&logcond);
|
|
|
|
|
|
|
|
}
|
|
|
|
AST_LIST_UNLOCK(&logmsgs);
|
|
|
|
AST_LIST_UNLOCK(&logmsgs);
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
logger_print_normal(logmsg);
|
|
|
|
logger_print_normal(logmsg);
|
|
|
|
logmsg_free(logmsg);
|
|
|
|
logmsg_free(logmsg);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void ast_log(int level, const char *file, int line, const char *function, const char *fmt, ...)
|
|
|
|
void ast_log(int level, const char *file, int line, const char *function, const char *fmt, ...)
|
|
|
|