Add engine internal error macro mjERROR to prepend calling function to error function.
PiperOrigin-RevId: 541584847 Change-Id: I57447e64375413ee07aa96372a402e1ced59ff4a
This commit is contained in:
committed by
Copybara-Service
parent
c9e9cd8b35
commit
ac1f41160d
@@ -123,16 +123,11 @@ void mju_writeLog(const char* type, const char* msg) {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// write message to logfile and console, pause and exit
|
||||
void mju_error(const char* msg, ...) {
|
||||
void mju_error_v(const char* msg, va_list args) {
|
||||
char errmsg[1000];
|
||||
|
||||
// Format msg into errmsg
|
||||
va_list args;
|
||||
va_start(args, msg);
|
||||
vsnprintf(errmsg, mjSIZEOFARRAY(errmsg), msg, args);
|
||||
va_end(args);
|
||||
|
||||
if (_mjPRIVATE_tls_error_fn) {
|
||||
_mjPRIVATE_tls_error_fn(errmsg);
|
||||
@@ -150,6 +145,16 @@ void mju_error(const char* msg, ...) {
|
||||
}
|
||||
|
||||
|
||||
// write message to logfile and console, pause and exit
|
||||
void mju_error(const char* msg, ...) {
|
||||
va_list args;
|
||||
va_start(args, msg);
|
||||
mju_error_v(msg, args);
|
||||
va_end(args);
|
||||
}
|
||||
|
||||
|
||||
|
||||
// write message to logfile and console
|
||||
void mju_warning(const char* msg, ...) {
|
||||
char wrnmsg[1000];
|
||||
|
||||
Reference in New Issue
Block a user