Changeset 3018


Ignore:
Timestamp:
09/10/2011 23:52:00 (8 months ago)
Author:
chris
Message:

Log fatal exceptions in main helper using BOX_FATAL instead of printf, to
ensure they get logged in all the right places.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • box/trunk/lib/common/MainHelper.h

    r1161 r3018  
    1414 
    1515#include "BoxException.h" 
     16#include "Logging.h" 
    1617 
    1718#define MAINHELPER_START                                                                        \ 
     
    2223        try { 
    2324#define MAINHELPER_END                                                                                                                          \ 
    24         } catch(BoxException &e) {                                                                                                              \ 
    25         printf("Exception: %s (%d/%d)\n", e.what(), e.GetType(), e.GetSubType());               \ 
    26         return 1;                                                                                                                                               \ 
    2725        } catch(std::exception &e) {                                                                                                    \ 
    28         printf("Exception: %s\n", e.what());                                                                                    \ 
    29         return 1;                                                                                                                                               \ 
     26                BOX_FATAL(e.what()); \ 
     27                return 1;                                                                                                                                               \ 
    3028        } catch(...) {                                                                                                                                  \ 
    31         printf("Exception: <UNKNOWN>\n");                                                                                               \ 
    32         return 1; } 
     29                BOX_FATAL("UNKNOWN"); \ 
     30                return 1; \ 
     31        } 
    3332 
    3433#ifdef BOX_MEMORY_LEAK_TESTING 
Note: See TracChangeset for help on using the changeset viewer.