summaryrefslogtreecommitdiffstats
path: root/common
diff options
context:
space:
mode:
authorDmitri Pal <dpal@redhat.com>2009-10-16 23:23:38 -0400
committerStephen Gallagher <sgallagh@redhat.com>2009-12-10 17:20:26 -0500
commit7faf7764c8b99bd51e952f24350dcdb05f9ab78e (patch)
treeb185378a2bf0a760fb27e4335112a22fe97e790d /common
parent0948f16059b5b5afaec144aab149c1714aecdf0f (diff)
downloadsssd-7faf7764c8b99bd51e952f24350dcdb05f9ab78e.tar.gz
sssd-7faf7764c8b99bd51e952f24350dcdb05f9ab78e.tar.xz
sssd-7faf7764c8b99bd51e952f24350dcdb05f9ab78e.zip
COMMON Improvements to the trace macro
Added more distingushable indication to the trace messages that represent errors.
Diffstat (limited to 'common')
-rw-r--r--common/trace/trace.h24
1 files changed, 15 insertions, 9 deletions
diff --git a/common/trace/trace.h b/common/trace/trace.h
index b2604fd58..c7e375b7b 100644
--- a/common/trace/trace.h
+++ b/common/trace/trace.h
@@ -44,9 +44,11 @@ extern unsigned trace_level;
#define TRACE_STRING(level, msg, str) \
do { \
if (level & trace_level) { \
- printf("[DEBUG] %23s (%4d) %s %s\n", \
- __FILE__, __LINE__, (msg != NULL) ? msg : "MISSING MESSAGE", \
- (str != NULL) ? str : "(null)"); \
+ printf("[DEBUG] %40s (%4d) %s%s %s\n", \
+ __FILE__, __LINE__, \
+ (level == TRACE_ERROR) ? "ERROR-> " : "", \
+ (msg != NULL) ? msg : "MISSING MESSAGE", \
+ (str != NULL) ? str : "(null)"); \
} \
} while(0)
@@ -54,9 +56,11 @@ extern unsigned trace_level;
#define TRACE_NUMBER(level, msg, num) \
do { \
if (level & trace_level) { \
- printf("[DEBUG] %23s (%4d) %s %lu\n", \
- __FILE__, __LINE__, (msg != NULL) ? msg : "MISSING MESSAGE", \
- (unsigned long int)(num)); \
+ printf("[DEBUG] %40s (%4d) %s%s %lu\n", \
+ __FILE__, __LINE__, \
+ (level == TRACE_ERROR) ? "ERROR-> " : "", \
+ (msg != NULL) ? msg : "MISSING MESSAGE", \
+ (unsigned long int)(num)); \
} \
} while(0)
@@ -64,9 +68,11 @@ extern unsigned trace_level;
#define TRACE_DOUBLE(level, msg, num) \
do { \
if (level & trace_level) { \
- printf("[DEBUG] %23s (%4d) %s %e\n", \
- __FILE__, __LINE__, (msg != NULL) ? msg : "MISSING MESSAGE", \
- (double)(num)); \
+ printf("[DEBUG] %40s (%4d) %s%s %e\n", \
+ __FILE__, __LINE__, \
+ (level == TRACE_ERROR) ? "ERROR-> " : "", \
+ (msg != NULL) ? msg : "MISSING MESSAGE", \
+ (double)(num)); \
} \
} while(0)