diff options
author | Sean Hall <r.sean.hall@gmail.com> | 2020-07-12 17:07:55 +1000 |
---|---|---|
committer | Sean Hall <r.sean.hall@gmail.com> | 2020-07-12 17:16:16 +1000 |
commit | dc558da002794cc07013e8376f3c55c73391aa0e (patch) | |
tree | faba96f981f1ea0c6888b387cf43cc78d0bc2927 /src/dutil | |
parent | aeddc77fc021f11f68a4c1a093eabf9776866b80 (diff) | |
download | wix-dc558da002794cc07013e8376f3c55c73391aa0e.tar.gz wix-dc558da002794cc07013e8376f3c55c73391aa0e.tar.bz2 wix-dc558da002794cc07013e8376f3c55c73391aa0e.zip |
Update Dutil_TraceErrorSource to filter based on the report level.
Diffstat (limited to 'src/dutil')
-rw-r--r-- | src/dutil/dutil.cpp | 6 | ||||
-rw-r--r-- | src/dutil/inc/dutil.h | 13 | ||||
-rw-r--r-- | src/dutil/inc/dutilsources.h | 10 |
3 files changed, 17 insertions, 12 deletions
diff --git a/src/dutil/dutil.cpp b/src/dutil/dutil.cpp index a32de516..99ce1bc6 100644 --- a/src/dutil/dutil.cpp +++ b/src/dutil/dutil.cpp | |||
@@ -408,6 +408,12 @@ DAPIV_(void) Dutil_TraceErrorSource( | |||
408 | ... | 408 | ... |
409 | ) | 409 | ) |
410 | { | 410 | { |
411 | // if this is NOT an error report and we're not logging at this level, bail | ||
412 | if (REPORT_ERROR != rl && Dutil_rlCurrentTrace < rl) | ||
413 | { | ||
414 | return; | ||
415 | } | ||
416 | |||
411 | if (DUTIL_SOURCE_UNKNOWN != source && vpfnTraceErrorCallback) | 417 | if (DUTIL_SOURCE_UNKNOWN != source && vpfnTraceErrorCallback) |
412 | { | 418 | { |
413 | va_list args; | 419 | va_list args; |
diff --git a/src/dutil/inc/dutil.h b/src/dutil/inc/dutil.h index 6b57b48a..15d45d21 100644 --- a/src/dutil/inc/dutil.h +++ b/src/dutil/inc/dutil.h | |||
@@ -10,17 +10,6 @@ | |||
10 | #define DAPIV_(type) EXTERN_C type DAPIV | 10 | #define DAPIV_(type) EXTERN_C type DAPIV |
11 | 11 | ||
12 | 12 | ||
13 | // enums | ||
14 | typedef enum REPORT_LEVEL | ||
15 | { | ||
16 | REPORT_NONE, // turns off report (only valid for XXXSetLevel()) | ||
17 | REPORT_WARNING, // written if want only warnings or reporting is on in general | ||
18 | REPORT_STANDARD, // written if reporting is on | ||
19 | REPORT_VERBOSE, // written only if verbose reporting is on | ||
20 | REPORT_DEBUG, // reporting useful when debugging code | ||
21 | REPORT_ERROR, // always gets reported, but can never be specified | ||
22 | } REPORT_LEVEL; | ||
23 | |||
24 | // asserts and traces | 13 | // asserts and traces |
25 | typedef BOOL (DAPI *DUTIL_ASSERTDISPLAYFUNCTION)(__in_z LPCSTR sz); | 14 | typedef BOOL (DAPI *DUTIL_ASSERTDISPLAYFUNCTION)(__in_z LPCSTR sz); |
26 | 15 | ||
@@ -29,7 +18,7 @@ typedef void (CALLBACK *DUTIL_CALLBACK_TRACEERROR)( | |||
29 | __in int iLine, | 18 | __in int iLine, |
30 | __in REPORT_LEVEL rl, | 19 | __in REPORT_LEVEL rl, |
31 | __in UINT source, | 20 | __in UINT source, |
32 | __in HRESULT hr, | 21 | __in HRESULT hrError, |
33 | __in_z __format_string LPCSTR szFormat, | 22 | __in_z __format_string LPCSTR szFormat, |
34 | __in va_list args | 23 | __in va_list args |
35 | ); | 24 | ); |
diff --git a/src/dutil/inc/dutilsources.h b/src/dutil/inc/dutilsources.h index bf3da16f..b03013ca 100644 --- a/src/dutil/inc/dutilsources.h +++ b/src/dutil/inc/dutilsources.h | |||
@@ -63,3 +63,13 @@ typedef enum DUTIL_SOURCE | |||
63 | 63 | ||
64 | DUTIL_SOURCE_EXTERNAL = 256, | 64 | DUTIL_SOURCE_EXTERNAL = 256, |
65 | } DUTIL_SOURCE; | 65 | } DUTIL_SOURCE; |
66 | |||
67 | typedef enum REPORT_LEVEL | ||
68 | { | ||
69 | REPORT_NONE, // turns off report (only valid for XXXSetLevel()) | ||
70 | REPORT_WARNING, // written if want only warnings or reporting is on in general | ||
71 | REPORT_STANDARD, // written if reporting is on | ||
72 | REPORT_VERBOSE, // written only if verbose reporting is on | ||
73 | REPORT_DEBUG, // reporting useful when debugging code | ||
74 | REPORT_ERROR, // always gets reported, but can never be specified | ||
75 | } REPORT_LEVEL; | ||