PageRenderTime 18ms CodeModel.GetById 8ms app.highlight 7ms RepoModel.GetById 1ms app.codeStats 1ms

/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
 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
29#include <vector>
30
31#include "linden_common.h"
32
33#include "llapp.h"
34#include "llsd.h"
35#include "llcontrol.h"
36
37class LLCrashLogger : public LLApp
38{
39public:
40	LLCrashLogger();
41	virtual ~LLCrashLogger();
42	S32 loadCrashBehaviorSetting();
43	void gatherFiles();
44	virtual void gatherPlatformSpecificFiles() {}
45	bool saveCrashBehaviorSetting(S32 crash_behavior);
46	bool sendCrashLogs();
47	LLSD constructPostData();
48	virtual void updateApplication(const std::string& message = LLStringUtil::null);
49	virtual bool init();
50	virtual bool mainLoop() = 0;
51	virtual bool cleanup() = 0;
52	void commonCleanup();
53	void setUserText(const std::string& text) { mCrashInfo["UserNotes"] = text; }
54	S32 getCrashBehavior() { return mCrashBehavior; }
55	bool runCrashLogPost(std::string host, LLSD data, std::string msg, int retries, int timeout);
56protected:
57	S32 mCrashBehavior;
58	BOOL mCrashInPreviousExec;
59	std::map<std::string, std::string> mFileMap;
60	std::string mGridName;
61	LLControlGroup mCrashSettings;
62	std::string mProductName;
63	LLSD mCrashInfo;
64	std::string mCrashHost;
65	std::string mAltCrashHost;
66	LLSD mDebugLog;
67	bool mSentCrashLogs;
68};
69
70#endif //LLCRASHLOGGER_H