The Netsukuku Project  0.0.9
An Alternative routing method
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros
log.h File Reference
#include <stdarg.h>
Include dependency graph for log.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define ERROR_MSG   "%s:%d: "
 
#define ERROR_POS   __FILE__, __LINE__
 
#define ERROR_FUNC   __FUNCTION__, __LINE__
 
#define DBG_NORMAL   1
 
#define DBG_SOFT   2
 
#define DBG_NOISE   3
 
#define DBG_INSANE   4
 
#define ERROR_FINISH(ret, err, label_finish)
 
#define BLACK(x)   x
 
#define RED(x)   x
 
#define GREEN(x)   x
 
#define BROWN(x)   x
 
#define BLUE(x)   x
 
#define PURPLE(x)   x
 
#define CYAN(x)   x
 
#define LIGHTGRAY(x)   x
 
#define DARKGRAY(x)   x
 
#define LIGHTRED(x)   x
 
#define LIGHTGREEN(x)   x
 
#define YELLOW(x)   x
 
#define LIGHTBLUE(x)   x
 
#define MAGENTA(x)   x
 
#define LIGHTCYAN(x)   x
 
#define WHITE(x)   x
 

Functions

void log_init (char *, int, int)
 
int log_to_file (char *filename)
 
void close_log_file (void)
 
void fatal (const char *,...) __attribute__((noreturn))
 
void error (const char *,...)
 
void loginfo (const char *,...)
 
void debug (int lvl, const char *,...)
 
void print_log (int level, const char *fmt, va_list args)
 

Macro Definition Documentation

#define BLACK (   x)    x
#define BLUE (   x)    x
#define BROWN (   x)    x
#define CYAN (   x)    x
#define DARKGRAY (   x)    x
#define DBG_INSANE   4
#define DBG_NOISE   3
#define DBG_NORMAL   1
#define DBG_SOFT   2
#define ERROR_FINISH (   ret,
  err,
  label_finish 
)
Value:
({ \
void *_label_finish=&&label_finish; \
(ret)=(err); \
goto *_label_finish; \
\
(ret); /* in this way gcc thinks this macro returns
an integer */ \
})
#define ERROR_FUNC   __FUNCTION__, __LINE__
#define ERROR_MSG   "%s:%d: "
#define ERROR_POS   __FILE__, __LINE__
#define GREEN (   x)    x
#define LIGHTBLUE (   x)    x
#define LIGHTCYAN (   x)    x
#define LIGHTGRAY (   x)    x
#define LIGHTGREEN (   x)    x
#define LIGHTRED (   x)    x
#define MAGENTA (   x)    x
#define PURPLE (   x)    x
#define RED (   x)    x
#define WHITE (   x)    x
#define YELLOW (   x)    x

Function Documentation

void close_log_file ( void  )

Here is the caller graph for this function:

void debug ( int  lvl,
const char *  ,
  ... 
)

Here is the call graph for this function:

void error ( const char *  ,
  ... 
)

Here is the call graph for this function:

void fatal ( const char *  ,
  ... 
)

Flush the stream if we want to read something

Here is the call graph for this function:

void log_init ( char *  ,
int  ,
int   
)

Here is the caller graph for this function:

int log_to_file ( char *  filename)

Here is the call graph for this function:

Here is the caller graph for this function:

void loginfo ( const char *  ,
  ... 
)

Here is the call graph for this function:

Here is the caller graph for this function:

void print_log ( int  level,
const char *  fmt,
va_list  args 
)

Here is the caller graph for this function: