mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-03 03:20:57 +00:00
loader: Improve error handling.
* Display list of unavailable dependencies when they cause another module to fail loading. * When a module declines to load find all modules which depend on it so they can be declined and listed together. * Prevent retry of declined modules during startup. * When a module fails to dlopen try loading it with RTLD_LAZY so we can attempt to display the list of missing dependencies. These changes are meant to reduce logger spam that is caused when a module has many dependencies and declines to load. This also fixes some error paths which failed to recognize required modules. Module load/start errors are delayed until the end of loader startup. Change-Id: I046052c71331c556c09d39f47a3b92975f3e1758
This commit is contained in:
@@ -2004,18 +2004,24 @@ static void __attribute__((format(printf, 7, 0))) ast_log_full(int level, int su
|
||||
|
||||
void ast_log(int level, const char *file, int line, const char *function, const char *fmt, ...)
|
||||
{
|
||||
ast_callid callid;
|
||||
va_list ap;
|
||||
|
||||
va_start(ap, fmt);
|
||||
ast_log_ap(level, file, line, function, fmt, ap);
|
||||
va_end(ap);
|
||||
}
|
||||
|
||||
void ast_log_ap(int level, const char *file, int line, const char *function, const char *fmt, va_list ap)
|
||||
{
|
||||
ast_callid callid;
|
||||
|
||||
callid = ast_read_threadstorage_callid();
|
||||
|
||||
va_start(ap, fmt);
|
||||
if (level == __LOG_VERBOSE) {
|
||||
__ast_verbose_ap(file, line, function, 0, callid, fmt, ap);
|
||||
} else {
|
||||
ast_log_full(level, -1, file, line, function, callid, fmt, ap);
|
||||
}
|
||||
va_end(ap);
|
||||
}
|
||||
|
||||
void ast_log_safe(int level, const char *file, int line, const char *function, const char *fmt, ...)
|
||||
|
Reference in New Issue
Block a user