3 * $Id: logger.c,v 1.8 2002/05/14 13:24:47 yusuke Exp $
8 #include <anthy/anthy.h>
9 #include <anthy/logger.h>
11 static void (*logger)(int lv, const char *str);
12 static int current_level = 1;
15 anthy_do_set_logger(void (*fn)(int lv, const char *str), int lv)
19 /* to be implemented */
23 do_log(int lv, const char *str, va_list arg)
25 if (lv < current_level) {
28 fprintf(stderr, "Anthy: ");
29 vfprintf(stderr, str, arg);
33 anthy_log(int lv, const char *str, ...)
36 if (lv > current_level) {
45 anthy_set_logger(anthy_logger lg, int level)
47 anthy_do_set_logger(lg, level);