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: main.c,v 1.6.4.2 2007-05-23 17:18:12 zer0 Exp $
25 #include <aversive/wait.h>
29 #include <aversive/error.h>
30 #include <aversive/pgmspace.h>
33 void mylog(struct error * e, ...)
38 printf_P(PSTR("[%d]: E%d "), e->severity, e->err_num);
39 vfprintf_P(stdout, e->text, ap);
42 printf_P(PSTR(", L%d\n"), e->line);
52 fdevopen(uart0_dev_send,NULL);
56 printf_P(PSTR("test error module\n"));
57 printf("%d\n",sizeof(va_list));
59 /* don't display anything */
62 error_register_emerg(mylog);
63 error_register_error(mylog);
65 EMERG(3, "this is an emerg log");
66 EMERG(3, "this is an emerg log with param %d", 453);
67 ERROR(54, "this is another log, level = error");
69 /* don't display it, fcts are not registered */
70 WARNING(4, "not displayed");
71 NOTICE(5, "not displayed");
72 DEBUG(6, "not displayed");