Robust Distributed System Nucleus (rDSN)  ver 1.0.0
Macros | Typedefs | Enumerations | Functions | Variables
Logging Service

Overview

Note developers can plug into rDSN their own logging libraryS implementation, so as to integrate rDSN logs into their own cluster operation systems.

Macros

#define dlog(level, title, ...)
 
#define dinfo(...)   dlog(LOG_LEVEL_INFORMATION, __TITLE__, __VA_ARGS__)
 
#define ddebug(...)   dlog(LOG_LEVEL_DEBUG, __TITLE__, __VA_ARGS__)
 
#define dwarn(...)   dlog(LOG_LEVEL_WARNING, __TITLE__, __VA_ARGS__)
 
#define derror(...)   dlog(LOG_LEVEL_ERROR, __TITLE__, __VA_ARGS__)
 
#define dfatal(...)   dlog(LOG_LEVEL_FATAL, __TITLE__, __VA_ARGS__)
 
#define dassert(x, ...)
 
#define dbg_dassert   dassert
 

Typedefs

typedef enum dsn_log_level_t dsn_log_level_t
 

Enumerations

enum  dsn_log_level_t {
  LOG_LEVEL_INFORMATION, LOG_LEVEL_DEBUG, LOG_LEVEL_WARNING, LOG_LEVEL_ERROR,
  LOG_LEVEL_FATAL, LOG_LEVEL_COUNT, LOG_LEVEL_INVALID
}
 

Functions

DSN_API dsn_log_level_t dsn_log_get_start_level ()
 
DSN_API void dsn_logv (const char *file, const char *function, const int line, dsn_log_level_t log_level, const char *title, const char *fmt, va_list args)
 
DSN_API void dsn_logf (const char *file, const char *function, const int line, dsn_log_level_t log_level, const char *title, const char *fmt,...)
 
DSN_API void dsn_log (const char *file, const char *function, const int line, dsn_log_level_t log_level, const char *title)
 
DSN_API void dsn_coredump ()
 

Variables

DSN_API dsn_log_level_t dsn_log_start_level
 

Macro Definition Documentation

#define dlog (   level,
  title,
  ... 
)
Value:
do {if (level >= dsn_log_start_level) \
dsn_logf(__FILE__, __FUNCTION__, __LINE__, level, title, __VA_ARGS__); } while(false)
#define dassert (   x,
  ... 
)
Value:
do { if (!(x)) { \
dlog(LOG_LEVEL_FATAL, __FILE__, "assertion expression: "#x); \
dlog(LOG_LEVEL_FATAL, __FILE__, __VA_ARGS__); \
dsn_coredump(); \
} } while (false)