diff options
author | Chris Wilson <chris+github@qwirx.com> | 2011-10-09 22:52:00 +0000 |
---|---|---|
committer | Chris Wilson <chris+github@qwirx.com> | 2011-10-09 22:52:00 +0000 |
commit | 44376290b3bdea1c0a40fa070e9a2740f10f1e62 (patch) | |
tree | 60d7063530530625889f03916df7a2a8073a0373 /lib/common | |
parent | 8ede2c87437a2403a6308152af45797211090c32 (diff) |
Log fatal exceptions in main helper using BOX_FATAL instead of printf, to
ensure they get logged in all the right places.
Diffstat (limited to 'lib/common')
-rw-r--r-- | lib/common/MainHelper.h | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/lib/common/MainHelper.h b/lib/common/MainHelper.h index d91bc2f9..3c973624 100644 --- a/lib/common/MainHelper.h +++ b/lib/common/MainHelper.h @@ -13,6 +13,7 @@ #include <stdio.h> #include "BoxException.h" +#include "Logging.h" #define MAINHELPER_START \ if(argc == 2 && ::strcmp(argv[1], "--version") == 0) \ @@ -21,15 +22,13 @@ MEMLEAKFINDER_START \ try { #define MAINHELPER_END \ - } catch(BoxException &e) { \ - printf("Exception: %s (%d/%d)\n", e.what(), e.GetType(), e.GetSubType()); \ - return 1; \ } catch(std::exception &e) { \ - printf("Exception: %s\n", e.what()); \ - return 1; \ + BOX_FATAL(e.what()); \ + return 1; \ } catch(...) { \ - printf("Exception: <UNKNOWN>\n"); \ - return 1; } + BOX_FATAL("UNKNOWN"); \ + return 1; \ + } #ifdef BOX_MEMORY_LEAK_TESTING #define MAINHELPER_SETUP_MEMORY_LEAK_EXIT_REPORT(file, marker) \ |