Revised OpenFlow Library  v0.6.0dev
 All Classes Files Functions Variables Friends Groups Pages
Macros | Enumerations | Functions | Variables
c_logger.h File Reference

Lightweight platform-indepedent C logger. More...

#include <stdlib.h>
#include <stdio.h>
#include <rofl.h>

Go to the source code of this file.

Macros

#define ROFL_DEFAULT_LEVELS   { DBG_LEVEL } /* default for each class */
 
#define ROFL_DEBUG_CHECK(cn, level)   ( rofl_debug_level[cn] >= level )
 
#define ROFL_DEBUG_PRINT(fd, cn, level, stuff,...)
 
#define ROFL_WARN(stuff,...)   ROFL_DEBUG_PRINT(stderr, DEFAULT, WARN_LEVEL, stuff, ##__VA_ARGS__)
 
#define ROFL_ERR(stuff,...)   ROFL_DEBUG_PRINT(stderr, DEFAULT, ERROR_LEVEL, stuff, ##__VA_ARGS__)
 
#define ROFL_INFO(stuff,...)   ROFL_DEBUG_PRINT(stderr, DEFAULT, INFO_LEVEL, stuff, ##__VA_ARGS__)
 
#define ROFL_DEBUG(stuff,...)   do{}while(0)
 
#define ROFL_DEBUG_VERBOSE(stuff,...)   do{}while(0)
 

Enumerations

enum  rofl_debug_levels {
  UNDEF_DEBUG_LEVEL = -1, ERROR_LEVEL, WARN_LEVEL, INFO_LEVEL,
  DBG_LEVEL, DBG_VERBOSE_LEVEL, MAX_DEBUG_LEVEL
}
 
enum  rofl_debug_class { UNDEF_DEBUG_CLASS = -1, DEFAULT = 0, MAX_DEBUG_CLASS }
 

Functions

ROFL_BEGIN_DECLS void rofl_set_logging_function (int(*logging_func)(FILE *stream, const char *format,...))
 
void rofl_set_logging_level (enum rofl_debug_levels level)
 

Variables

enum rofl_debug_levels rofl_debug_level [MAX_DEBUG_CLASS]
 
int(* rofl_debug_print )(FILE *stream, const char *format,...)
 

Detailed Description

Lightweight platform-indepedent C logger.

Author
Tobias Jungel<tobias.jungel (at) bisdn.de>, Marc Sune<marc.sune (at) bisdn.de>

Macro Definition Documentation

#define ROFL_DEBUG_PRINT (   fd,
  cn,
  level,
  stuff,
  ... 
)
Value:
do{\
if (ROFL_DEBUG_CHECK(cn, level) && *rofl_debug_print != NULL){ \
rofl_debug_print(fd,stuff, ##__VA_ARGS__);\
}\
}while(0)