aboutsummaryrefslogtreecommitdiff
path: root/src/dutil/inc/logutil.h
diff options
context:
space:
mode:
authorSean Hall <r.sean.hall@gmail.com>2020-06-22 19:06:48 +1000
committerSean Hall <r.sean.hall@gmail.com>2020-06-24 20:23:44 +1000
commit7fc25bc32547277c38bbedceb39c454843af8aac (patch)
treeddc28b69bc4d39a15fd788069a5d8a0f903a0ad4 /src/dutil/inc/logutil.h
parent57536725e6061c7f6cd0f532c07beca7cd1228c9 (diff)
downloadwix-7fc25bc32547277c38bbedceb39c454843af8aac.tar.gz
wix-7fc25bc32547277c38bbedceb39c454843af8aac.tar.bz2
wix-7fc25bc32547277c38bbedceb39c454843af8aac.zip
Replace ExitTrace with new DUTIL_CALLBACK_TRACEERROR callback.
This allows capturing internal dutil errors and eventually supports filtering to certain parts of dutil. Add Exit...Source macros to simplify calling both TraceError/TraceErrorDebug and Dutil_TraceErrorSource. Make existing Exit macros call the new Exit...Source macros so the logic is in one place.
Diffstat (limited to 'src/dutil/inc/logutil.h')
-rw-r--r--src/dutil/inc/logutil.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/dutil/inc/logutil.h b/src/dutil/inc/logutil.h
index ee0cd065..426506ee 100644
--- a/src/dutil/inc/logutil.h
+++ b/src/dutil/inc/logutil.h
@@ -6,9 +6,11 @@
6extern "C" { 6extern "C" {
7#endif 7#endif
8 8
9#define LogExitOnFailure(x, i, f, ...) if (FAILED(x)) { LogErrorId(x, i, __VA_ARGS__); ExitTrace(x, f, __VA_ARGS__); goto LExit; } 9#define LogExitOnFailureSource(d, x, i, f, ...) if (FAILED(x)) { LogErrorId(x, i, __VA_ARGS__); ExitTraceSource(d, x, f, __VA_ARGS__); goto LExit; }
10#define LogExitOnRootFailureSource(d, x, i, f, ...) if (FAILED(x)) { LogErrorId(x, i, __VA_ARGS__); Dutil_RootFailure(__FILE__, __LINE__, x); ExitTraceSource(d, x, f, __VA_ARGS__); goto LExit; }
10 11
11#define LogExitOnRootFailure(x, i, f, ...) if (FAILED(x)) { LogErrorId(x, i, __VA_ARGS__); Dutil_RootFailure(__FILE__, __LINE__, x); ExitTrace(x, f, __VA_ARGS__); goto LExit; } 12#define LogExitOnFailure(x, i, f, ...) LogExitOnFailureSource(DUTIL_SOURCE_DEFAULT, x, i, f, __VA_ARGS__)
13#define LogExitOnRootFailure(x, i, f, ...) LogExitOnRootFailureSource(DUTIL_SOURCE_DEFAULT, x, i, f, __VA_ARGS__)
12 14
13typedef HRESULT (DAPI *PFN_LOGSTRINGWORKRAW)( 15typedef HRESULT (DAPI *PFN_LOGSTRINGWORKRAW)(
14 __in_z LPCSTR szString, 16 __in_z LPCSTR szString,