Integrated LogVisor for error gathering

This commit is contained in:
Jack Andersen
2015-07-03 20:02:12 -10:00
parent 602c54541a
commit a656c5d4c9
11 changed files with 44 additions and 53 deletions

View File

@@ -4,6 +4,9 @@
namespace NOD
{
LogVisor::LogModule LogModule("NODLib");
std::unique_ptr<IDiscIO> NewDiscIOISO(const SystemChar* path);
std::unique_ptr<IDiscIO> NewDiscIOWBFS(const SystemChar* path);
@@ -18,9 +21,9 @@ std::unique_ptr<DiscBase> OpenDiscFromImage(const SystemChar* path, bool& isWii)
if (!fp)
{
#if NOD_UCS2
fwprintf(stderr, L"Unable to open '%s'\n", path);
LogModule.report(LogVisor::Error, L"Unable to open '%s'\n", path);
#else
fprintf(stderr, "Unable to open '%s'\n", path);
LogModule.report(LogVisor::Error, "Unable to open '%s'\n", path);
#endif
return std::unique_ptr<DiscBase>();
}
@@ -63,9 +66,9 @@ std::unique_ptr<DiscBase> OpenDiscFromImage(const SystemChar* path, bool& isWii)
if (!discIO)
{
#if NOD_UCS2
fwprintf(stderr, L"'%s' is not a valid image\n", path);
LogModule.report(LogVisor::Error, L"'%s' is not a valid image\n", path);
#else
fprintf(stderr, "'%s' is not a valid image\n", path);
LogModule.report(LogVisor::Error, "'%s' is not a valid image\n", path);
#endif
return std::unique_ptr<DiscBase>();
}