00001 00031 #ifndef LLCRASHLOGGER_H 00032 #define LLCRASHLOGGER_H 00033 00034 #include <vector> 00035 00036 #include "linden_common.h" 00037 00038 #include "llapp.h" 00039 #include "llsd.h" 00040 #include "llcontrol.h" 00041 00042 class LLCrashLogger : public LLApp 00043 { 00044 public: 00045 LLCrashLogger(); 00046 virtual ~LLCrashLogger(); 00047 S32 loadCrashBehaviorSetting(); 00048 void gatherFiles(); 00049 virtual void gatherPlatformSpecificFiles() {} 00050 bool saveCrashBehaviorSetting(S32 crash_behavior); 00051 bool sendCrashLogs(); 00052 LLSD constructPostData(); 00053 virtual void updateApplication(LLString message = ""); 00054 virtual bool init(); 00055 virtual bool mainLoop() = 0; 00056 virtual bool cleanup() { return true; } 00057 void setUserText(LLString& text) { mCrashInfo["UserNotes"] = text; } 00058 S32 getCrashBehavior() { return mCrashBehavior; } 00059 bool runCrashLogPost(LLString host, LLSD data, LLString msg, int retries, int timeout); 00060 protected: 00061 S32 mCrashBehavior; 00062 BOOL mCrashInPreviousExec; 00063 std::map<LLString, LLString> mFileMap; 00064 LLString mGridName; 00065 LLControlGroup mCrashSettings; 00066 LLString mProductName; 00067 LLSD mCrashInfo; 00068 LLString mCrashHost; 00069 LLString mAltCrashHost; 00070 LLSD mDebugLog; 00071 bool mSentCrashLogs; 00072 }; 00073 00074 class LLCrashLoggerText : public LLCrashLogger 00075 { 00076 public: 00077 LLCrashLoggerText(void) {} 00078 ~LLCrashLoggerText(void) {} 00079 00080 virtual bool mainLoop(); 00081 virtual void updateApplication(LLString message = ""); 00082 }; 00083 00084 00085 #endif //LLCRASHLOGGER_H