From b9d89b8c1d05d406bfb634b254d2f728a9239550 Mon Sep 17 00:00:00 2001 From: Rolf Ahrenberg Date: Mon, 8 Dec 2014 21:23:23 +0200 Subject: [PATCH] Added more debugging macros. --- config.h | 28 ++++++++++++++++++---------- log.h | 28 ++++++++++++++++++---------- 2 files changed, 36 insertions(+), 20 deletions(-) diff --git a/config.h b/config.h index 84b2efc..9507d78 100644 --- a/config.h +++ b/config.h @@ -31,16 +31,24 @@ public: eOperatingModeCount }; enum eLoggingMode { - eLoggingModeNormal = 0x00, - eLoggingModeDebug1 = 0x01, - eLoggingModeDebug2 = 0x02, - eLoggingModeDebug3 = 0x04, - eLoggingModeDebug4 = 0x08, - eLoggingModeDebug5 = 0x10, - eLoggingModeDebug6 = 0x20, - eLoggingModeDebug7 = 0x40, - eLoggingModeDebug8 = 0x80, - eLoggingModeMask = 0xFF + eLoggingModeNormal = 0x0000, + eLoggingModeDebug1 = 0x0001, + eLoggingModeDebug2 = 0x0002, + eLoggingModeDebug3 = 0x0004, + eLoggingModeDebug4 = 0x0008, + eLoggingModeDebug5 = 0x0010, + eLoggingModeDebug6 = 0x0020, + eLoggingModeDebug7 = 0x0040, + eLoggingModeDebug8 = 0x0080, + eLoggingModeDebug9 = 0x0100, + eLoggingModeDebug10 = 0x0200, + eLoggingModeDebug11 = 0x0400, + eLoggingModeDebug12 = 0x0800, + eLoggingModeDebug13 = 0x1000, + eLoggingModeDebug14 = 0x2000, + eLoggingModeDebug15 = 0x4000, + eLoggingModeDebug16 = 0x8000, + eLoggingModeMask = 0xFFFF }; cSatipConfig(); unsigned int GetOperatingMode(void) const { return operatingModeM; } diff --git a/log.h b/log.h index 9d9a4bd..3054911 100644 --- a/log.h +++ b/log.h @@ -10,16 +10,24 @@ #include "config.h" -#define error(x...) esyslog("SATIP-ERROR: " x) -#define info(x...) isyslog("SATIP: " x) -#define debug1(x...) void( SatipConfig.IsLoggingMode(cSatipConfig::eLoggingModeDebug1) ? dsyslog("SATIP1: " x) : void() ) -#define debug2(x...) void( SatipConfig.IsLoggingMode(cSatipConfig::eLoggingModeDebug2) ? dsyslog("SATIP2: " x) : void() ) -#define debug3(x...) void( SatipConfig.IsLoggingMode(cSatipConfig::eLoggingModeDebug3) ? dsyslog("SATIP3: " x) : void() ) -#define debug4(x...) void( SatipConfig.IsLoggingMode(cSatipConfig::eLoggingModeDebug4) ? dsyslog("SATIP4: " x) : void() ) -#define debug5(x...) void( SatipConfig.IsLoggingMode(cSatipConfig::eLoggingModeDebug5) ? dsyslog("SATIP5: " x) : void() ) -#define debug6(x...) void( SatipConfig.IsLoggingMode(cSatipConfig::eLoggingModeDebug6) ? dsyslog("SATIP6: " x) : void() ) -#define debug7(x...) void( SatipConfig.IsLoggingMode(cSatipConfig::eLoggingModeDebug7) ? dsyslog("SATIP7: " x) : void() ) -#define debug8(x...) void( SatipConfig.IsLoggingMode(cSatipConfig::eLoggingModeDebug8) ? dsyslog("SATIP8: " x) : void() ) +#define error(x...) esyslog("SATIP-ERROR: " x) +#define info(x...) isyslog("SATIP: " x) +#define debug1(x...) void( SatipConfig.IsLoggingMode(cSatipConfig::eLoggingModeDebug1) ? dsyslog("SATIP1: " x) : void() ) +#define debug2(x...) void( SatipConfig.IsLoggingMode(cSatipConfig::eLoggingModeDebug2) ? dsyslog("SATIP2: " x) : void() ) +#define debug3(x...) void( SatipConfig.IsLoggingMode(cSatipConfig::eLoggingModeDebug3) ? dsyslog("SATIP3: " x) : void() ) +#define debug4(x...) void( SatipConfig.IsLoggingMode(cSatipConfig::eLoggingModeDebug4) ? dsyslog("SATIP4: " x) : void() ) +#define debug5(x...) void( SatipConfig.IsLoggingMode(cSatipConfig::eLoggingModeDebug5) ? dsyslog("SATIP5: " x) : void() ) +#define debug6(x...) void( SatipConfig.IsLoggingMode(cSatipConfig::eLoggingModeDebug6) ? dsyslog("SATIP6: " x) : void() ) +#define debug7(x...) void( SatipConfig.IsLoggingMode(cSatipConfig::eLoggingModeDebug7) ? dsyslog("SATIP7: " x) : void() ) +#define debug8(x...) void( SatipConfig.IsLoggingMode(cSatipConfig::eLoggingModeDebug8) ? dsyslog("SATIP8: " x) : void() ) +#define debug9(x...) void( SatipConfig.IsLoggingMode(cSatipConfig::eLoggingModeDebug9) ? dsyslog("SATIP9: " x) : void() ) +#define debug10(x...) void( SatipConfig.IsLoggingMode(cSatipConfig::eLoggingModeDebug10) ? dsyslog("SATIP10: " x) : void() ) +#define debug11(x...) void( SatipConfig.IsLoggingMode(cSatipConfig::eLoggingModeDebug11) ? dsyslog("SATIP11: " x) : void() ) +#define debug12(x...) void( SatipConfig.IsLoggingMode(cSatipConfig::eLoggingModeDebug12) ? dsyslog("SATIP12: " x) : void() ) +#define debug13(x...) void( SatipConfig.IsLoggingMode(cSatipConfig::eLoggingModeDebug13) ? dsyslog("SATIP13: " x) : void() ) +#define debug14(x...) void( SatipConfig.IsLoggingMode(cSatipConfig::eLoggingModeDebug14) ? dsyslog("SATIP14: " x) : void() ) +#define debug15(x...) void( SatipConfig.IsLoggingMode(cSatipConfig::eLoggingModeDebug15) ? dsyslog("SATIP15: " x) : void() ) +#define debug16(x...) void( SatipConfig.IsLoggingMode(cSatipConfig::eLoggingModeDebug16) ? dsyslog("SATIP16: " x) : void() ) #endif // __SATIP_LOG_H