4 * Copyright Metaparadigm Pte. Ltd. 2004.
5 * Michael Clark <michael@metaparadigm.com>
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public (LGPL)
9 * License as published by the Free Software Foundation; either
10 * version 2.1 of the License, or (at your option) any later version.
12 * This library is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details: http://www.gnu.org/
25 #include <sys/param.h>
30 static int _syslog = 0;
31 static int _debug = 0;
33 void mc_set_debug(int debug) { _debug = debug; }
34 int mc_get_debug() { return _debug; }
36 extern void mc_set_syslog(int syslog)
41 void mc_abort(const char *msg, ...)
45 if(_syslog) vsyslog(LOG_ERR, msg, ap);
46 else vprintf(msg, ap);
51 void mc_debug(const char *msg, ...)
56 if(_syslog) vsyslog(LOG_DEBUG, msg, ap);
57 else vprintf(msg, ap);
61 void mc_error(const char *msg, ...)
65 if(_syslog) vsyslog(LOG_ERR, msg, ap);
66 else vfprintf(stderr, msg, ap);
69 void mc_info(const char *msg, ...)
73 if(_syslog) vsyslog(LOG_INFO, msg, ap);
74 else vfprintf(stderr, msg, ap);