2 * Copyright 2004, 2005 Red Hat Inc., Durham, North Carolina.
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Lesser General Public
7 * License as published by the Free Software Foundation; either
8 * version 2.1 of the License, or (at your option) any later version.
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Lesser General Public License for more details.
15 * You should have received a copy of the GNU Lesser General Public
16 * License along with this library; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 * Steve Grubb <sgrubb@redhat.com>
29 /* The message mode refers to where informational messages go
30 0 - stderr, 1 - syslog, 2 - quiet. The default is quiet. */
31 static message_t message_mode = MSG_QUIET;
32 static debug_message_t debug_message = DBG_NO;
34 void set_aumessage_mode(message_t mode, debug_message_t debug)
37 debug_message = debug;
40 void audit_msg(int priority, const char *fmt, ...)
44 if (message_mode == MSG_QUIET)
47 if (priority == LOG_DEBUG && debug_message == DBG_NO)
51 if (message_mode == MSG_SYSLOG)
52 vsyslog(priority, fmt, ap);
54 vfprintf(stderr, fmt, ap);