PageRenderTime 27ms CodeModel.GetById 15ms RepoModel.GetById 0ms app.codeStats 0ms

/indra/llcrashlogger/llcrashlogger.h

https://bitbucket.org/lindenlab/viewer-beta/
C Header | 70 lines | 40 code | 5 blank | 25 comment | 0 complexity | 7af1c623cf6f82a83c8145fcb2e8187f MD5 | raw file
Possible License(s): LGPL-2.1
  1. /**
  2. * @file llcrashlogger.h
  3. * @brief Crash Logger Definition
  4. *
  5. * $LicenseInfo:firstyear=2003&license=viewerlgpl$
  6. * Second Life Viewer Source Code
  7. * Copyright (C) 2010, Linden Research, Inc.
  8. *
  9. * This library is free software; you can redistribute it and/or
  10. * modify it under the terms of the GNU Lesser General Public
  11. * License as published by the Free Software Foundation;
  12. * version 2.1 of the License only.
  13. *
  14. * This library is distributed in the hope that it will be useful,
  15. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  16. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  17. * Lesser General Public License for more details.
  18. *
  19. * You should have received a copy of the GNU Lesser General Public
  20. * License along with this library; if not, write to the Free Software
  21. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  22. *
  23. * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
  24. * $/LicenseInfo$
  25. */
  26. #ifndef LLCRASHLOGGER_H
  27. #define LLCRASHLOGGER_H
  28. #include <vector>
  29. #include "linden_common.h"
  30. #include "llapp.h"
  31. #include "llsd.h"
  32. #include "llcontrol.h"
  33. class LLCrashLogger : public LLApp
  34. {
  35. public:
  36. LLCrashLogger();
  37. virtual ~LLCrashLogger();
  38. S32 loadCrashBehaviorSetting();
  39. void gatherFiles();
  40. virtual void gatherPlatformSpecificFiles() {}
  41. bool saveCrashBehaviorSetting(S32 crash_behavior);
  42. bool sendCrashLogs();
  43. LLSD constructPostData();
  44. virtual void updateApplication(const std::string& message = LLStringUtil::null);
  45. virtual bool init();
  46. virtual bool mainLoop() = 0;
  47. virtual bool cleanup() = 0;
  48. void commonCleanup();
  49. void setUserText(const std::string& text) { mCrashInfo["UserNotes"] = text; }
  50. S32 getCrashBehavior() { return mCrashBehavior; }
  51. bool runCrashLogPost(std::string host, LLSD data, std::string msg, int retries, int timeout);
  52. protected:
  53. S32 mCrashBehavior;
  54. BOOL mCrashInPreviousExec;
  55. std::map<std::string, std::string> mFileMap;
  56. std::string mGridName;
  57. LLControlGroup mCrashSettings;
  58. std::string mProductName;
  59. LLSD mCrashInfo;
  60. std::string mCrashHost;
  61. std::string mAltCrashHost;
  62. LLSD mDebugLog;
  63. bool mSentCrashLogs;
  64. };
  65. #endif //LLCRASHLOGGER_H