From 680934812598d2c9116303f3245e7a9d60ff58bf Mon Sep 17 00:00:00 2001 From: Aura Linden Date: Tue, 3 Dec 2013 17:06:06 -0800 Subject: Creating a cleaner branch --- indra/win_crash_logger/win_crash_logger.cpp | 40 ++++++++++++++++++++++++++--- 1 file changed, 37 insertions(+), 3 deletions(-) (limited to 'indra/win_crash_logger/win_crash_logger.cpp') diff --git a/indra/win_crash_logger/win_crash_logger.cpp b/indra/win_crash_logger/win_crash_logger.cpp index 8e916ae437..ede81a406e 100755 --- a/indra/win_crash_logger/win_crash_logger.cpp +++ b/indra/win_crash_logger/win_crash_logger.cpp @@ -28,6 +28,34 @@ #include "stdafx.h" #include #include "llcrashloggerwindows.h" +#include + +//SPATTERS killme +#include +#include + +std::ofstream gCLOG; //SPATTERS for testing only remove ASAP. + +void flog (std::string msg) +{ + //Windows can't even write a goddamned file without fucking it up. + static bool first_time=true; + + std::cout << "Init Crash Logger" << std::endl; + static std::string logname="C:\\Users\\Aura\\AppData\\Roaming\\SecondLife\\logs\\WinCrashLog.log"; + if (first_time) + { + gCLOG.open(logname, std::fstream::out); //first time open for overwrite. + first_time = false; + gCLOG << "BEGINNING Windows Crash Report Log\n"; + } + else + gCLOG.open(logname, std::fstream::out | std::fstream::app); + + gCLOG << msg << "\n"; + gCLOG.close(); +} +//END SPATTERS KILLME int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, @@ -35,17 +63,23 @@ int APIENTRY WinMain(HINSTANCE hInstance, int nCmdShow) { llinfos << "Starting crash reporter." << llendl; - LLCrashLoggerWindows app; app.setHandle(hInstance); app.parseCommandOptions(__argc, __argv); + LLSD options = LLApp::instance()->getOptionData( + LLApp::PRIORITY_COMMAND_LINE); + if (!(options.has("pid") && options.has("dumpdir"))) + { + llwarns << "Insufficient parameters to crash report." << llendl; + } if (! app.init()) { llwarns << "Unable to initialize application." << llendl; - return -1; + return 1; } - + flog("Hi there."); + app.processingLoop(); app.mainLoop(); app.cleanup(); llinfos << "Crash reporter finished normally." << llendl; -- cgit v1.2.3 From ce2cd00cc516dbff712956875d4565b8d26e44ca Mon Sep 17 00:00:00 2001 From: Aura Linden Date: Wed, 4 Dec 2013 19:57:11 -0800 Subject: Removed debugging code. --- indra/win_crash_logger/win_crash_logger.cpp | 29 +---------------------------- 1 file changed, 1 insertion(+), 28 deletions(-) (limited to 'indra/win_crash_logger/win_crash_logger.cpp') diff --git a/indra/win_crash_logger/win_crash_logger.cpp b/indra/win_crash_logger/win_crash_logger.cpp index ede81a406e..0078559c24 100755 --- a/indra/win_crash_logger/win_crash_logger.cpp +++ b/indra/win_crash_logger/win_crash_logger.cpp @@ -30,33 +30,6 @@ #include "llcrashloggerwindows.h" #include -//SPATTERS killme -#include -#include - -std::ofstream gCLOG; //SPATTERS for testing only remove ASAP. - -void flog (std::string msg) -{ - //Windows can't even write a goddamned file without fucking it up. - static bool first_time=true; - - std::cout << "Init Crash Logger" << std::endl; - static std::string logname="C:\\Users\\Aura\\AppData\\Roaming\\SecondLife\\logs\\WinCrashLog.log"; - if (first_time) - { - gCLOG.open(logname, std::fstream::out); //first time open for overwrite. - first_time = false; - gCLOG << "BEGINNING Windows Crash Report Log\n"; - } - else - gCLOG.open(logname, std::fstream::out | std::fstream::app); - - gCLOG << msg << "\n"; - gCLOG.close(); -} -//END SPATTERS KILLME - int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, @@ -78,7 +51,7 @@ int APIENTRY WinMain(HINSTANCE hInstance, llwarns << "Unable to initialize application." << llendl; return 1; } - flog("Hi there."); + app.processingLoop(); app.mainLoop(); app.cleanup(); -- cgit v1.2.3 From ea7e6a5174f1bdfc51ada864736d354706534d8b Mon Sep 17 00:00:00 2001 From: Aura Linden Date: Tue, 14 Jan 2014 15:28:35 -0800 Subject: Some cleanup of string to wstring conversion and vice versa. --- indra/win_crash_logger/win_crash_logger.cpp | 1 - 1 file changed, 1 deletion(-) (limited to 'indra/win_crash_logger/win_crash_logger.cpp') diff --git a/indra/win_crash_logger/win_crash_logger.cpp b/indra/win_crash_logger/win_crash_logger.cpp index 0078559c24..0f125028a3 100755 --- a/indra/win_crash_logger/win_crash_logger.cpp +++ b/indra/win_crash_logger/win_crash_logger.cpp @@ -28,7 +28,6 @@ #include "stdafx.h" #include #include "llcrashloggerwindows.h" -#include int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, -- cgit v1.2.3 From d2bb4dae980a887a30b206875d8f9419901ed66a Mon Sep 17 00:00:00 2001 From: Aura Linden Date: Fri, 7 Mar 2014 14:58:22 -0800 Subject: Fixes for crash reporter startup race condition, crash reporter CPU use, Secondlife.log filehandle, XP Crash. --- indra/win_crash_logger/win_crash_logger.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/win_crash_logger/win_crash_logger.cpp') diff --git a/indra/win_crash_logger/win_crash_logger.cpp b/indra/win_crash_logger/win_crash_logger.cpp index 0f125028a3..79b8514725 100755 --- a/indra/win_crash_logger/win_crash_logger.cpp +++ b/indra/win_crash_logger/win_crash_logger.cpp @@ -34,7 +34,7 @@ int APIENTRY WinMain(HINSTANCE hInstance, LPSTR lpCmdLine, int nCmdShow) { - llinfos << "Starting crash reporter." << llendl; + llinfos << "Starting crash reporter with args" << &lpCmdLine << llendl; LLCrashLoggerWindows app; app.setHandle(hInstance); app.parseCommandOptions(__argc, __argv); -- cgit v1.2.3