2 * simple logging functions that can be expanded into nothing
4 * Copyright (C) 2003-2004 Greg Kroah-Hartman <greg@kroah.com>
5 * Copyright (C) 2004-2006 Kay Sievers <kay.sievers@vrfy.org>
7 * This program is free software; you can redistribute it and/or modify it
8 * under the terms of the GNU General Public License as published by the
9 * Free Software Foundation version 2 of the License.
11 * This program is distributed in the hope that it will be useful, but
12 * WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * General Public License for more details.
16 * You should have received a copy of the GNU General Public License along
17 * with this program; if not, write to the Free Software Foundation, Inc.,
18 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
25 #define err(format, arg...) do { } while (0)
26 #define info(format, arg...) do { } while (0)
27 #define dbg(format, arg...) do { } while (0)
28 #define logging_init(foo) do { } while (0)
29 #define logging_close(foo) do { } while (0)
37 #define err(format, arg...) \
39 log_message(LOG_ERR ,"%s: " format ,__FUNCTION__ ,## arg); \
43 #define info(format, arg...) \
45 log_message(LOG_INFO ,"%s: " format ,__FUNCTION__ ,## arg); \
50 #define dbg(format, arg...) \
52 log_message(LOG_DEBUG ,"%s: " format ,__FUNCTION__ ,## arg); \
56 extern void log_message(int priority, const char *format, ...)
57 __attribute__ ((format (printf, 2, 3)));
60 static inline void logging_init(const char *program_name)
62 openlog(program_name, LOG_PID | LOG_CONS, LOG_DAEMON);
66 static inline void logging_close(void)