5 * Copyright (C) 2007-2009 Intel Corporation. All rights reserved.
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
31 static volatile gboolean debug_enabled = FALSE;
35 * @format: format string
36 * @Varargs: list of arguments
38 * Output general information
40 void connman_info(const char *format, ...)
46 vsyslog(LOG_INFO, format, ap);
53 * @format: format string
54 * @varargs: list of arguments
56 * Output error messages
58 void connman_error(const char *format, ...)
64 vsyslog(LOG_ERR, format, ap);
71 * @format: format string
72 * @varargs: list of arguments
74 * Output debug message
76 * The actual output of the debug message is controlled via a command line
77 * switch. If not enabled, these messages will be ignored.
79 void connman_debug(const char *format, ...)
83 if (debug_enabled == FALSE)
88 vsyslog(LOG_DEBUG, format, ap);
93 int __connman_log_init(gboolean detach, gboolean debug)
95 int option = LOG_NDELAY | LOG_PID;
100 openlog("connmand", option, LOG_DAEMON);
102 syslog(LOG_INFO, "Connection Manager version %s", VERSION);
104 debug_enabled = debug;
109 void __connman_log_cleanup(void)
111 syslog(LOG_INFO, "Exit");