aversive_10-03-12/modules/debug/error/error.h File Reference

#include <aversive/pgmspace.h>
#include <aversive.h>
#include <general_errors.h>
#include "error_config.h"

Go to the source code of this file.

Data Structures

struct  error
struct  error_fct

Defines

#define ERROR_SEVERITY_EMERG   0
#define ERROR_SEVERITY_ERROR   1
#define ERROR_SEVERITY_WARNING   2
#define ERROR_SEVERITY_NOTICE   3
#define ERROR_SEVERITY_DEBUG   4
#define EMERG(num, text,...)
#define ERROR(num, text,...)
#define WARNING(num, text,...)
#define NOTICE(num, text,...)
#define DEBUG(num, text,...)

Functions

struct error error_generate (uint8_t num, uint8_t severity, PGM_P t, PGM_P f, uint16_t l)
void error_register_emerg (void(*f)(struct error *,...))
void error_register_error (void(*f)(struct error *,...))
void error_register_warning (void(*f)(struct error *,...))
void error_register_notice (void(*f)(struct error *,...))
void error_register_debug (void(*f)(struct error *,...))

Variables

struct error_fct g_error_fct


Define Documentation

#define DEBUG ( num,
text,
...   ) 

Value:

do {                                            \
        if(g_error_fct.debug) {                                                \
                struct error e = error_generate(num, ERROR_SEVERITY_DEBUG,     \
                                                                PSTR(text),    \
                                                                PSTR(__FILE__),\
                                                                __LINE__);     \
                g_error_fct.debug(&e, ##__VA_ARGS__);                          \
        }                                                                      \
} while(0)
Call this macro to log DEBUG events

Definition at line 127 of file error.h.

#define EMERG ( num,
text,
...   ) 

Value:

do {                                            \
        if(g_error_fct.emerg) {                                                \
                struct error e = error_generate(num, ERROR_SEVERITY_EMERG,     \
                                                                PSTR(text),    \
                                                                PSTR(__FILE__),\
                                                                __LINE__);     \
                g_error_fct.emerg(&e, ##__VA_ARGS__);                          \
        }                                                                      \
} while(0)
Call this macro to log EMERG events

Definition at line 83 of file error.h.

#define ERROR ( num,
text,
...   ) 

Value:

do {                                            \
        if(g_error_fct.error) {                                                \
                struct error e = error_generate(num, ERROR_SEVERITY_ERROR,     \
                                                                PSTR(text),    \
                                                                PSTR(__FILE__),\
                                                                __LINE__);     \
                g_error_fct.error(&e, ##__VA_ARGS__);                          \
        }                                                                      \
} while(0)
Call this macro to log ERROR events

Definition at line 94 of file error.h.

#define ERROR_SEVERITY_DEBUG   4

Definition at line 39 of file error.h.

Referenced by mylog().

#define ERROR_SEVERITY_EMERG   0

Definition at line 35 of file error.h.

Referenced by mylog().

#define ERROR_SEVERITY_ERROR   1

Definition at line 36 of file error.h.

Referenced by mylog().

#define ERROR_SEVERITY_NOTICE   3

Definition at line 38 of file error.h.

Referenced by mylog().

#define ERROR_SEVERITY_WARNING   2

Definition at line 37 of file error.h.

Referenced by mylog().

#define NOTICE ( num,
text,
...   ) 

Value:

do {                                           \
        if(g_error_fct.notice) {                                               \
                struct error e = error_generate(num, ERROR_SEVERITY_NOTICE,    \
                                                                PSTR(text),    \
                                                                PSTR(__FILE__),\
                                                                __LINE__);     \
                g_error_fct.notice(&e, ##__VA_ARGS__);                         \
        }                                                                      \
} while(0)
Call this macro to log NOTICE events

Definition at line 116 of file error.h.

#define WARNING ( num,
text,
...   ) 

Value:

do {                                          \
        if(g_error_fct.warning) {                                              \
                struct error e = error_generate(num, ERROR_SEVERITY_WARNING,   \
                                                                PSTR(text),    \
                                                                PSTR(__FILE__),\
                                                                __LINE__);     \
                g_error_fct.warning(&e, ##__VA_ARGS__);                        \
        }                                                                      \
} while(0)
Call this macro to log WARNING events

Definition at line 105 of file error.h.


Function Documentation

struct error error_generate ( uint8_t  num,
uint8_t  severity,
PGM_P  t,
PGM_P  f,
uint16_t  l 
) [read]

void error_register_debug ( void(*)(struct error *,...)  f  ) 

Register log function for DEBUG level

Definition at line 103 of file error.c.

References error_fct::debug, parse_symbols::f, g_error_fct, IRQ_LOCK, and IRQ_UNLOCK.

Referenced by main().

void error_register_emerg ( void(*)(struct error *,...)  f  ) 

Register log function for EMERG level

Definition at line 67 of file error.c.

References error_fct::emerg, parse_symbols::f, g_error_fct, IRQ_LOCK, and IRQ_UNLOCK.

Referenced by main().

void error_register_error ( void(*)(struct error *,...)  f  ) 

Register log function for ERROR level

Definition at line 76 of file error.c.

References error_fct::error, parse_symbols::f, g_error_fct, IRQ_LOCK, and IRQ_UNLOCK.

Referenced by main().

void error_register_notice ( void(*)(struct error *,...)  f  ) 

Register log function for NOTICE level

Definition at line 94 of file error.c.

References parse_symbols::f, g_error_fct, IRQ_LOCK, IRQ_UNLOCK, and error_fct::notice.

Referenced by main().

void error_register_warning ( void(*)(struct error *,...)  f  ) 

Register log function for WARNING level

Definition at line 85 of file error.c.

References parse_symbols::f, g_error_fct, IRQ_LOCK, IRQ_UNLOCK, and error_fct::warning.

Referenced by main().


Variable Documentation


Generated on Fri Mar 12 06:30:24 2010 for AVR by  doxygen 1.5.6