]>
jfr.im git - irc/thales.git/blob - src/log_worker.c
1 /* Log worker of GNU Thales. Copyright (C)
2 2012 Free Software Foundation, Inc. This file is part of GNU Thales.
4 GNU Thales is free software; you can redistribute it and/or modify it under the
5 terms of the GNU General Public License as published by the Free Software
6 Foundation; either version 3 of the License, or (at your option) any later
9 GNU Make is distributed in the hope that it will be useful, but
10 WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 General Public License for more details.
14 You should have received a copy of the GNU General Public License along with
15 this program. If not, see <http://www.gnu.org/licenses/>. */
16 #include "log_worker.h"
19 log_worker_function(const char *msg
, struct irc_meta
*meta
, void *config
)
28 create_log_worker(const struct envz
*env
)
30 struct log_options
*inner_opts
;
31 struct worker
*worker
;
32 const char *output_filename
= envz_get(env
->envz
, env
->envz_len
, "output");
33 FILE *output_file
= NULL
;
34 if (output_filename
&& !(output_file
= fopen(output_filename
, "a"))) {
35 fprintf(stderr
, "log worker: specified file `%s' can not be appended\n",
40 worker
= xmalloc(sizeof *worker
);
41 worker
->config
= output_file
;