mirror of
https://github.com/wiiu-env/ContentRedirectionModule.git
synced 2025-05-20 15:47:04 +02:00
Improve and fix logging
This commit is contained in:
parent
ecd3cc03b2
commit
8811d7ae0a
@ -28,12 +28,12 @@ FSError FSWrapperMergeDirsWithParent::FSOpenDirWrapper(const char *path,
|
|||||||
|
|
||||||
if (clientHandle) {
|
if (clientHandle) {
|
||||||
FSADirectoryHandle realHandle = 0;
|
FSADirectoryHandle realHandle = 0;
|
||||||
DEBUG_FUNCTION_LINE_ERR("[%s] Call FSAOpenDir with %s for parent layer", getName().c_str(), path);
|
DEBUG_FUNCTION_LINE_VERBOSE("[%s] Call FSAOpenDir with %s for parent layer", getName().c_str(), path);
|
||||||
// Call FSOpen with "this" as errorFlag call FSOpen for "parent" layers only.
|
FSError err;
|
||||||
if (FSAOpenDir(clientHandle, path, &realHandle) == FS_ERROR_OK) {
|
if ((err = FSAOpenDir(clientHandle, path, &realHandle)) == FS_ERROR_OK) {
|
||||||
dirHandle->realDirHandle = realHandle;
|
dirHandle->realDirHandle = realHandle;
|
||||||
} else {
|
} else {
|
||||||
DEBUG_FUNCTION_LINE_VERBOSE("[%s] Failed to open real dir %s", getName().c_str(), path);
|
DEBUG_FUNCTION_LINE_ERR("[%s] Failed to open real dir %s. %s (%d)", getName().c_str(), path, FSAGetStatusStr(err), err);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
DEBUG_FUNCTION_LINE_ERR("[%s] clientHandle was null", getName().c_str());
|
DEBUG_FUNCTION_LINE_ERR("[%s] clientHandle was null", getName().c_str());
|
||||||
@ -99,7 +99,7 @@ FSError FSWrapperMergeDirsWithParent::FSReadDirWrapper(FSADirectoryHandle handle
|
|||||||
FSADirectoryEntry realDirEntry;
|
FSADirectoryEntry realDirEntry;
|
||||||
FSError readDirResult;
|
FSError readDirResult;
|
||||||
while (true) {
|
while (true) {
|
||||||
DEBUG_FUNCTION_LINE_ERR("[%s] Call FSReadDir with %08X for parent layer", getName().c_str(), dirHandle->realDirHandle);
|
DEBUG_FUNCTION_LINE_VERBOSE("[%s] Call FSReadDir with %08X for parent layer", getName().c_str(), dirHandle->realDirHandle);
|
||||||
readDirResult = FSAReadDir(clientHandle, dirHandle->realDirHandle, &realDirEntry);
|
readDirResult = FSAReadDir(clientHandle, dirHandle->realDirHandle, &realDirEntry);
|
||||||
if (readDirResult == FS_ERROR_OK) {
|
if (readDirResult == FS_ERROR_OK) {
|
||||||
bool found = false;
|
bool found = false;
|
||||||
@ -128,7 +128,7 @@ FSError FSWrapperMergeDirsWithParent::FSReadDirWrapper(FSADirectoryHandle handle
|
|||||||
res = FS_ERROR_END_OF_DIR;
|
res = FS_ERROR_END_OF_DIR;
|
||||||
break;
|
break;
|
||||||
} else {
|
} else {
|
||||||
DEBUG_FUNCTION_LINE_ERR("[%s] real_FSReadDir returned an unexpected error: %08X", getName().c_str(), readDirResult);
|
DEBUG_FUNCTION_LINE_ERR("[%s] real_FSReadDir returned an unexpected error: %s (%d)", getName().c_str(), FSAGetStatusStr(readDirResult), readDirResult);
|
||||||
res = FS_ERROR_END_OF_DIR;
|
res = FS_ERROR_END_OF_DIR;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -156,17 +156,19 @@ FSError FSWrapperMergeDirsWithParent::FSCloseDirWrapper(FSADirectoryHandle handl
|
|||||||
auto dirHandle = getDirExFromHandle(handle);
|
auto dirHandle = getDirExFromHandle(handle);
|
||||||
if (dirHandle->realDirHandle != 0) {
|
if (dirHandle->realDirHandle != 0) {
|
||||||
if (clientHandle) {
|
if (clientHandle) {
|
||||||
DEBUG_FUNCTION_LINE_ERR("[%s] Call FSCloseDir with %08X for parent layer", getName().c_str(), dirHandle->realDirHandle);
|
DEBUG_FUNCTION_LINE_VERBOSE("[%s] Call FSCloseDir with %08X for parent layer", getName().c_str(), dirHandle->realDirHandle);
|
||||||
auto realResult = FSACloseDir(clientHandle, dirHandle->realDirHandle);
|
auto realResult = FSACloseDir(clientHandle, dirHandle->realDirHandle);
|
||||||
if (realResult == FS_ERROR_OK) {
|
if (realResult == FS_ERROR_OK) {
|
||||||
dirHandle->realDirHandle = 0;
|
dirHandle->realDirHandle = 0;
|
||||||
} else {
|
} else {
|
||||||
DEBUG_FUNCTION_LINE_ERR("[%s] Failed to close realDirHandle %d: res %d", getName().c_str(), dirHandle->realDirHandle, -1);
|
DEBUG_FUNCTION_LINE_ERR("[%s] Failed to close realDirHandle %d: res %s (%d)", getName().c_str(), dirHandle->realDirHandle, FSAGetStatusStr(realResult), realResult);
|
||||||
return realResult == FS_ERROR_CANCELLED ? FS_ERROR_CANCELLED : FS_ERROR_MEDIA_ERROR;
|
return realResult == FS_ERROR_CANCELLED ? FS_ERROR_CANCELLED : FS_ERROR_MEDIA_ERROR;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
DEBUG_FUNCTION_LINE_ERR("[%s] clientHandle was null", getName().c_str());
|
DEBUG_FUNCTION_LINE_ERR("[%s] clientHandle was null", getName().c_str());
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
DEBUG_FUNCTION_LINE_VERBOSE("[%s] dirHandle->realDirHandle was 0", getName().c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (dirHandle->readResult != nullptr) {
|
if (dirHandle->readResult != nullptr) {
|
||||||
@ -199,15 +201,18 @@ FSError FSWrapperMergeDirsWithParent::FSRewindDirWrapper(FSADirectoryHandle hand
|
|||||||
|
|
||||||
if (dirHandle->realDirHandle != 0) {
|
if (dirHandle->realDirHandle != 0) {
|
||||||
if (clientHandle) {
|
if (clientHandle) {
|
||||||
DEBUG_FUNCTION_LINE_ERR("[%s] Call FSARewindDir with %08X for parent layer", getName().c_str(), dirHandle->realDirHandle);
|
DEBUG_FUNCTION_LINE_VERBOSE("[%s] Call FSARewindDir with %08X for parent layer", getName().c_str(), dirHandle->realDirHandle);
|
||||||
if (FSARewindDir(clientHandle, dirHandle->realDirHandle) == FS_ERROR_OK) {
|
FSError err;
|
||||||
|
if ((err = FSARewindDir(clientHandle, dirHandle->realDirHandle)) == FS_ERROR_OK) {
|
||||||
dirHandle->realDirHandle = 0;
|
dirHandle->realDirHandle = 0;
|
||||||
} else {
|
} else {
|
||||||
DEBUG_FUNCTION_LINE_ERR("[%s] Failed to rewind dir for realDirHandle %08X", getName().c_str(), dirHandle->realDirHandle);
|
DEBUG_FUNCTION_LINE_ERR("[%s] Failed to rewind dir for realDirHandle %08X. %s (%d)", getName().c_str(), dirHandle->realDirHandle, FSAGetStatusStr(err), err);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
DEBUG_FUNCTION_LINE_ERR("[%s] clientHandle was null", getName().c_str());
|
DEBUG_FUNCTION_LINE_ERR("[%s] clientHandle was null", getName().c_str());
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
DEBUG_FUNCTION_LINE_VERBOSE("[%s] dirHandle->realDirHandle was 0", getName().c_str());
|
||||||
}
|
}
|
||||||
OSMemoryBarrier();
|
OSMemoryBarrier();
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user