mirror of
https://github.com/f4exb/sdrangel.git
synced 2025-09-04 06:07:49 -04:00
Check for errors when writing to log
This commit is contained in:
parent
eb9fb3469d
commit
526164f2e1
@ -189,25 +189,29 @@ void Android::messageHandler(QtMsgType type, const QMessageLogContext& context,
|
|||||||
}
|
}
|
||||||
const char * const local = report.toLocal8Bit().constData();
|
const char * const local = report.toLocal8Bit().constData();
|
||||||
const char * const applicationName = "sdrangel";
|
const char * const applicationName = "sdrangel";
|
||||||
|
int ret;
|
||||||
switch (type)
|
switch (type)
|
||||||
{
|
{
|
||||||
case QtDebugMsg:
|
case QtDebugMsg:
|
||||||
__android_log_write(ANDROID_LOG_DEBUG, applicationName, local);
|
ret = __android_log_write(ANDROID_LOG_DEBUG, applicationName, local);
|
||||||
break;
|
break;
|
||||||
case QtInfoMsg:
|
case QtInfoMsg:
|
||||||
__android_log_write(ANDROID_LOG_INFO, applicationName, local);
|
ret = __android_log_write(ANDROID_LOG_INFO, applicationName, local);
|
||||||
break;
|
break;
|
||||||
case QtWarningMsg:
|
case QtWarningMsg:
|
||||||
__android_log_write(ANDROID_LOG_WARN, applicationName, local);
|
ret = __android_log_write(ANDROID_LOG_WARN, applicationName, local);
|
||||||
break;
|
break;
|
||||||
case QtCriticalMsg:
|
case QtCriticalMsg:
|
||||||
__android_log_write(ANDROID_LOG_ERROR, applicationName, local);
|
ret = __android_log_write(ANDROID_LOG_ERROR, applicationName, local);
|
||||||
break;
|
break;
|
||||||
case QtFatalMsg:
|
case QtFatalMsg:
|
||||||
default:
|
default:
|
||||||
__android_log_write(ANDROID_LOG_FATAL, applicationName, local);
|
ret = __android_log_write(ANDROID_LOG_FATAL, applicationName, local);
|
||||||
abort();
|
abort();
|
||||||
}
|
}
|
||||||
|
if (ret < 0) {
|
||||||
|
__android_log_write(ANDROID_LOG_ERROR, applicationName, "Error writing to log");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // ANDROID
|
#endif // ANDROID
|
||||||
|
Loading…
x
Reference in New Issue
Block a user