feat(util): Add log function for logging in exception handlers
We want this to always be visible, so the log level must be the highest possible. Unfortunately, that's quite the hack around the existing API and how fatal behaves. The log API stopped scaling already a while ago and needs considerable refactoring to consider the various use-cases that emerged since it was first created on alpha versions of bemanitools.
This commit is contained in:
@@ -64,6 +64,15 @@ static void log_builtin_format(
|
||||
}
|
||||
}
|
||||
|
||||
void log_exception_handler(const char *fmt, ...)
|
||||
{
|
||||
va_list ap;
|
||||
|
||||
va_start(ap, fmt);
|
||||
log_builtin_format(LOG_LEVEL_FATAL, LOG_MODULE, fmt, ap);
|
||||
va_end(ap);
|
||||
}
|
||||
|
||||
void log_assert_body(const char *file, int line, const char *function)
|
||||
{
|
||||
log_impl_fatal("assert", "%s:%d: function `%s'", file, line, function);
|
||||
|
||||
Reference in New Issue
Block a user