diff options
author | Dmitri Pal <dpal@redhat.com> | 2009-10-16 23:23:38 -0400 |
---|---|---|
committer | Stephen Gallagher <sgallagh@redhat.com> | 2009-12-10 17:20:26 -0500 |
commit | 8ee482cfeaf83bfbfd15d8c9e6c660793b43bbf3 (patch) | |
tree | a45e49ed0456bd2cd9e3a24be2c59f662c84b785 /trace | |
parent | 3076876258e79cf0db6e800a799b042b3ac5bea6 (diff) | |
download | ding-libs-8ee482cfeaf83bfbfd15d8c9e6c660793b43bbf3.tar.gz ding-libs-8ee482cfeaf83bfbfd15d8c9e6c660793b43bbf3.tar.xz ding-libs-8ee482cfeaf83bfbfd15d8c9e6c660793b43bbf3.zip |
COMMON Improvements to the trace macro
Added more distingushable indication to
the trace messages that represent errors.
Diffstat (limited to 'trace')
-rw-r--r-- | trace/trace.h | 24 |
1 files changed, 15 insertions, 9 deletions
diff --git a/trace/trace.h b/trace/trace.h index b2604fd..c7e375b 100644 --- a/trace/trace.h +++ b/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) |