2 * Copyright Droids Corporation, Microb Technology, Eirbot (2005)
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 * Revision : $Id: error.c,v 1.10.4.3 2007-12-31 16:25:00 zer0 Exp $
30 #include <aversive/error.h>
32 struct error_fct g_error_fct;
34 /** All fcts pointers to NULL */
39 memset(&g_error_fct, 0, sizeof(g_error_fct));
44 struct error error_generate(uint8_t num, uint8_t severity, PGM_P t,
53 e.severity = severity;
54 #ifdef ERROR_DUMP_TEXTLOG
59 #ifdef ERROR_DUMP_FILE_LINE
70 /** Register log function for EMERG level */
71 void error_register_emerg(void (*f)(struct error *, ...))
75 g_error_fct.emerg = f;
79 /** Register log function for ERROR level */
80 void error_register_error(void (*f)(struct error *, ...))
84 g_error_fct.error = f;
88 /** Register log function for WARNING level */
89 void error_register_warning(void (*f)(struct error *, ...))
93 g_error_fct.warning = f;
97 /** Register log function for NOTICE level */
98 void error_register_notice(void (*f)(struct error *, ...))
102 g_error_fct.notice = f;
106 /** Register log function for DEBUG level */
107 void error_register_debug(void (*f)(struct error *, ...))
111 g_error_fct.debug = f;