[Box Backup-commit] COMMIT r1548 - box/chris/merge/lib/common

boxbackup-dev@fluffy.co.uk boxbackup-dev@fluffy.co.uk
Sun, 22 Apr 2007 15:06:49 +0100


Author: chris
Date: 2007-04-22 15:06:49 +0100 (Sun, 22 Apr 2007)
New Revision: 1548

Modified:
   box/chris/merge/lib/common/Box.h
Log:
Use logging framework to log exceptions. (refs #3)


Modified: box/chris/merge/lib/common/Box.h
===================================================================
--- box/chris/merge/lib/common/Box.h	2007-04-22 14:05:55 UTC (rev 1547)
+++ box/chris/merge/lib/common/Box.h	2007-04-22 14:06:49 UTC (rev 1548)
@@ -27,13 +27,14 @@
 #endif
 
 #ifdef SHOW_BACKTRACE_ON_EXCEPTION
-  #include "Utils.h"
+	#include "Utils.h"
 	#define OPTIONAL_DO_BACKTRACE DumpStackBacktrace();
 #else
 	#define OPTIONAL_DO_BACKTRACE
 #endif
 
 #include "CommonException.h"
+#include "Logging.h"
 
 #ifndef NDEBUG
 	
@@ -108,11 +109,12 @@
 	#define MEMLEAKFINDER_STOP
 #endif
 
-#define THROW_EXCEPTION(type, subtype)														\
-	{																						\
-		OPTIONAL_DO_BACKTRACE																\
-		TRACE1("Exception thrown: " #type "(" #subtype ") at " __FILE__ "(%d)\n", __LINE__)	\
-		throw type(type::subtype);															\
+#define THROW_EXCEPTION(type, subtype) \
+	{ \
+		OPTIONAL_DO_BACKTRACE \
+		BOX_TRACE("Exception thrown: " #type "(" #subtype ") at " \
+			__FILE__ "(" << __LINE__ << ")") \
+		throw type(type::subtype); \
 	}
 
 // extra macros for converting to network byte order