File tree Expand file tree Collapse file tree 2 files changed +16
-8
lines changed
Expand file tree Collapse file tree 2 files changed +16
-8
lines changed Original file line number Diff line number Diff line change @@ -1669,24 +1669,26 @@ MetaPage::MetaPage() {
16691669 #ifdef USE_LIBRPXLOADER
16701670 uint32_t version;
16711671 if (const RPXLoaderStatus err = RPXLoader_GetVersion (&version); err != RPX_LOADER_RESULT_SUCCESS) {
1672- LOG_TO_DEBUG (" Displaying fallback save path, RPXLoader_GetVersion encountered error " + std::to_string (err));
1672+ LOG_TO_DEBUG (" Displaying fallback save path, RPXLoader_GetVersion encountered error " s + RPXLoader_GetStatusStr (err));
16731673 return ;
16741674 }
1675-
1675+
1676+ LOG_TO_DEBUG (" Found RPXLoadingModule version: " + std::to_string (version));
1677+
16761678 if (version < 3 ) {
16771679 LOG_TO_DEBUG (" Displaying fallback save path, librpxloader is outdated." );
16781680 return ;
16791681 }
16801682
16811683 if (const RPXLoaderStatus err = RPXLoader_InitLibrary (); err != RPX_LOADER_RESULT_SUCCESS) {
1682- LOG_TO_DEBUG (" Displaying fallback save path, RPXLoader_InitLibrary encountered error " + std::to_string (err));
1684+ LOG_TO_DEBUG (" Displaying fallback save path, RPXLoader_InitLibrary encountered error " s + RPXLoader_GetStatusStr (err));
16831685 return ;
16841686 }
16851687 rpxLoaderInit = true ;
16861688
16871689 std::array<char , 128 > pathBuf{}; // probably bigger than necessary
16881690 if (const RPXLoaderStatus err = RPXLoader_GetPathOfSaveRedirection (pathBuf.data (), pathBuf.size ()); err != RPX_LOADER_RESULT_SUCCESS) {
1689- LOG_TO_DEBUG (" Displaying fallback save path, RPXLoader_GetPathOfSaveRedirection encountered error " + std::to_string (err));
1691+ LOG_TO_DEBUG (" Displaying fallback save path, RPXLoader_GetPathOfSaveRedirection encountered error " s + RPXLoader_GetStatusStr (err));
16901692 return ;
16911693 }
16921694
Original file line number Diff line number Diff line change @@ -43,14 +43,20 @@ static bool flushVolume(const std::string& vol) {
4343 return true ;
4444}
4545
46- bool initMocha ()
47- {
46+ bool initMocha () {
4847 Utility::platformLog (" Starting libmocha..." );
4948
5049 if (const MochaUtilsStatus status = Mocha_InitLibrary (); status != MOCHA_RESULT_SUCCESS) {
51- ErrorLog::getInstance ().log (std::string (" Mocha_InitLibrary() failed, error " ) + Mocha_GetStatusStr (status));
50+ ErrorLog::getInstance ().log (std::string (" Mocha_InitLibrary failed, error " ) + Mocha_GetStatusStr (status));
51+ return false ;
52+ }
53+
54+ uint32_t version;
55+ if (const MochaUtilsStatus status = Mocha_CheckAPIVersion (&version); status != MOCHA_RESULT_SUCCESS) {
56+ LOG_TO_DEBUG (std::string (" Mocha_CheckAPIVersion encountered error " ) + Mocha_GetStatusStr (status));
5257 return false ;
5358 }
59+ LOG_TO_DEBUG (" Found Mocha version: " + std::to_string (version));
5460
5561 Utility::platformLog (" Mocha initialized" );
5662 return true ;
@@ -85,7 +91,7 @@ void closeMocha() {
8591 }
8692
8793 if (const MochaUtilsStatus status = Mocha_DeInitLibrary (); status != MOCHA_RESULT_SUCCESS) {
88- ErrorLog::getInstance ().log (std::string (" Mocha_DeinitLibrary() failed, error " ) + Mocha_GetStatusStr (status));
94+ ErrorLog::getInstance ().log (std::string (" Mocha_DeinitLibrary failed, error " ) + Mocha_GetStatusStr (status));
8995 }
9096
9197 return ;
You can’t perform that action at this time.
0 commit comments