From 7632bf8d0070615fd649e21a26c922f5efd666b4 Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Sat, 21 Dec 2002 18:12:03 +0000 Subject: [PATCH] log exceptions --- stepmania/src/RageException.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/stepmania/src/RageException.cpp b/stepmania/src/RageException.cpp index 23a93af483..86143e877d 100644 --- a/stepmania/src/RageException.cpp +++ b/stepmania/src/RageException.cpp @@ -12,6 +12,7 @@ #include "RageException.h" #include "RageUtil.h" +#include "RageLog.h" RageException::RageException( const char *fmt, ...) { @@ -38,6 +39,12 @@ RageException::ThrowFatal(const char *fmt, ...) CString error = vssprintf( fmt, va ); va_end(va); + if(LOG) + { + LOG->Trace("Fatal exception thrown: %s", error.GetString()); + LOG->Flush(); + } + #if defined(WIN32) && defined(DEBUG) MessageBox( NULL, error, "Fatal Error", MB_OK ); DebugBreak(); @@ -51,5 +58,11 @@ RageException::ThrowNonfatal(const char *fmt, ...) va_list va; va_start(va, fmt); + if(LOG) + { + LOG->Trace("Nonfatal exception thrown: %s", vssprintf( fmt, va ).GetString()); + LOG->Flush(); + } + throw RageException(fmt, va); }