2 * $Id: debug.c,v 1.5 2006/01/26 02:16:28 mclark Exp $
4 * Copyright (c) 2004, 2005 Metaparadigm Pte. Ltd.
5 * Michael Clark <michael@metaparadigm.com>
7 * This library is free software; you can redistribute it and/or modify
8 * it under the terms of the MIT license. See COPYING for details.
21 #endif /* HAVE_SYSLOG_H */
25 #endif /* HAVE_UNISTD_H */
28 #include <sys/param.h>
29 #endif /* HAVE_SYS_PARAM_H */
33 static int _syslog
= 0;
34 static int _debug
= 0;
36 void mc_set_debug(int debug
) { _debug
= debug
; }
37 int mc_get_debug() { return _debug
; }
39 extern void mc_set_syslog(int syslog
)
44 void mc_abort(const char *msg
, ...)
50 vsyslog(LOG_ERR
, msg
, ap
);
58 void mc_debug(const char *msg
, ...)
65 vsyslog(LOG_DEBUG
, msg
, ap
);
72 void mc_error(const char *msg
, ...)
78 vsyslog(LOG_ERR
, msg
, ap
);
81 vfprintf(stderr
, msg
, ap
);
84 void mc_info(const char *msg
, ...)
90 vsyslog(LOG_INFO
, msg
, ap
);
93 vfprintf(stderr
, msg
, ap
);