Distributed Publish Subscribe for IoT
dbg.h File Reference

Go to the source code of this file.

Macros

#define DPS_ERRPRINT(fmt, ...)   DPS_Log(DPS_LOG_ERROR, __FILE__, __LINE__, __FUNCTION__, fmt, ##__VA_ARGS__)
 
#define DPS_PRINT(fmt, ...)   DPS_Log(DPS_LOG_PRINT, __FILE__, __LINE__, __FUNCTION__, fmt, ##__VA_ARGS__)
 
#define DPS_PRINTT(fmt, ...)   DPS_Log(DPS_LOG_PRINTT, __FILE__, __LINE__, __FUNCTION__, fmt, ##__VA_ARGS__)
 
#define DPS_DEBUG_OFF   0
 
#define DPS_DEBUG_ON   1
 
#define DPS_DEBUG_FORCE   2
 
#define DPS_DEBUG_ENABLED()   ((DPS_Debug && (__DPS_DebugControl == DPS_DEBUG_ON)) || (__DPS_DebugControl == DPS_DEBUG_FORCE))
 
#define DPS_DBGTRACE()
 
#define DPS_DBGPRINT(...)
 
#define DPS_DEBUG_CONTROL(dbg)   __attribute__((__unused__))static int __DPS_DebugControl = dbg
 

Enumerations

enum  DPS_LogLevel {
  DPS_LOG_ERROR, DPS_LOG_PRINT, DPS_LOG_PRINTT, DPS_LOG_DBGTRACE,
  DPS_LOG_DBGPRINT
}
 

Functions

void DPS_Log (DPS_LogLevel level, const char *file, int line, const char *function, const char *fmt,...)
 

Variables

int DPS_Debug
 

Macro Definition Documentation

#define DPS_DBGPRINT (   ...)
#define DPS_DBGTRACE ( )
#define DPS_DEBUG_CONTROL (   dbg)    __attribute__((__unused__))static int __DPS_DebugControl = dbg
#define DPS_DEBUG_ENABLED ( )    ((DPS_Debug && (__DPS_DebugControl == DPS_DEBUG_ON)) || (__DPS_DebugControl == DPS_DEBUG_FORCE))
#define DPS_DEBUG_FORCE   2
#define DPS_DEBUG_OFF   0
#define DPS_DEBUG_ON   1
#define DPS_ERRPRINT (   fmt,
  ... 
)    DPS_Log(DPS_LOG_ERROR, __FILE__, __LINE__, __FUNCTION__, fmt, ##__VA_ARGS__)
#define DPS_PRINT (   fmt,
  ... 
)    DPS_Log(DPS_LOG_PRINT, __FILE__, __LINE__, __FUNCTION__, fmt, ##__VA_ARGS__)
#define DPS_PRINTT (   fmt,
  ... 
)    DPS_Log(DPS_LOG_PRINTT, __FILE__, __LINE__, __FUNCTION__, fmt, ##__VA_ARGS__)

Enumeration Type Documentation

Enumerator
DPS_LOG_ERROR 
DPS_LOG_PRINT 
DPS_LOG_PRINTT 
DPS_LOG_DBGTRACE 
DPS_LOG_DBGPRINT 

Function Documentation

void DPS_Log ( DPS_LogLevel  level,
const char *  file,
int  line,
const char *  function,
const char *  fmt,
  ... 
)

Variable Documentation

int DPS_Debug