X-Git-Url: http://git.tuebingen.mpg.de/?p=paraslash.git;a=blobdiff_plain;f=filter.c;h=ee08f28eadc60f53a1c301ffd3b917117914f119;hp=40fbc844b35c70fa0070ad3d9652110fc6ae83ea;hb=34762fdc56d5294c15e03fda433ecfccdc6c5fb2;hpb=c4b1b0d61d89e027582aaf87aa9fc737ff5554ff diff --git a/filter.c b/filter.c index 40fbc844..ee08f28e 100644 --- a/filter.c +++ b/filter.c @@ -49,27 +49,7 @@ static struct stdout_task *sot = &stdout_task_struct; /** gengetopt struct that holds the command line args */ static struct filter_args_info conf; - -/** - * standard log function that always writes to stderr - * - * \param ll loglevel. If the loglevel of the current message - * is less than \a ll, the message is going to be ignored. - * - * \param fmt the format string describing the log message. - * - */ -__printf_2_3 void para_log(int ll, const char* fmt,...) -{ - va_list argp; - - /* ignore log message if loglevel is not high enough */ - if (ll < conf.loglevel_arg) - return; - va_start(argp, fmt); - vfprintf(stderr, fmt, argp); - va_end(argp); -} +INIT_STDERR_LOGGING(conf.loglevel_arg); static void filter_event_handler(struct task *t) { @@ -134,6 +114,7 @@ static int parse_config(int argc, char *argv[]) if (filter_cmdline_parser(argc, argv, &conf)) return -E_FILTER_SYNTAX; + HANDLE_VERSION_FLAG("filter", conf); if (!cf) { char *home = para_homedir(); cf = make_message("%s/.paraslash/filter.conf", home); @@ -187,9 +168,9 @@ int main(int argc, char *argv[]) sot->loaded = fc->out_loaded; sot->input_eof = &fc->eof; - register_task(&sot->task); - register_task(&fc->task); register_task(&sit->task); + register_task(&fc->task); + register_task(&sot->task); s.default_timeout.tv_sec = 1; s.default_timeout.tv_usec = 0; ret = sched(&s);