logging: add basic logging capabilities
This commit is contained in:
@@ -15,7 +15,7 @@
|
||||
* with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Copyright (C) 2006 - 2008 Red Hat, Inc.
|
||||
* Copyright (C) 2006 - 2010 Red Hat, Inc.
|
||||
* Copyright (C) 2006 - 2008 Novell, Inc.
|
||||
*/
|
||||
|
||||
@@ -24,8 +24,51 @@
|
||||
|
||||
#include <glib.h>
|
||||
|
||||
void nm_logging_setup (gboolean become_daemon);
|
||||
void nm_logging_backtrace (void);
|
||||
void nm_logging_shutdown (void);
|
||||
/* Log domains */
|
||||
enum {
|
||||
LOGD_NONE = 0x00000000,
|
||||
LOGD_HW = 0x00000001,
|
||||
LOGD_RFKILL = 0x00000002,
|
||||
LOGD_ETHER = 0x00000004,
|
||||
LOGD_WIFI = 0x00000008,
|
||||
LOGD_BT = 0x00000010,
|
||||
LOGD_MB = 0x00000020, /* mobile broadband */
|
||||
LOGD_DHCP4 = 0x00000040,
|
||||
LOGD_DHCP6 = 0x00000080,
|
||||
LOGD_PPP = 0x00000100,
|
||||
LOGD_WIFI_SCAN = 0x00000200,
|
||||
LOGD_IP4 = 0x00000400,
|
||||
LOGD_IP6 = 0x00000800,
|
||||
LOGD_AUTOIP4 = 0x00001000,
|
||||
LOGD_DNS = 0x00002000,
|
||||
LOGD_VPN = 0x00004000,
|
||||
LOGD_SHARING = 0x00008000,
|
||||
LOGD_SUPPLICANT = 0x00010000,
|
||||
LOGD_USER_SET = 0x00020000,
|
||||
LOGD_SYS_SET = 0x00040000,
|
||||
LOGD_SUSPEND = 0x00080000,
|
||||
LOGD_CORE = 0x00100000, /* Core daemon and policy stuff */
|
||||
};
|
||||
|
||||
/* Log levels */
|
||||
enum {
|
||||
LOGL_ERR = 0x00000000,
|
||||
LOGL_WARN = 0x00000001,
|
||||
LOGL_INFO = 0x00000002,
|
||||
LOGL_DEBUG = 0x00000004
|
||||
};
|
||||
|
||||
#define nm_log(domain, level, fmt, args...) \
|
||||
{ _nm_log (G_STRFUNC, G_STRLOC, domain, level, fmt, ##args); }
|
||||
|
||||
void _nm_log (const char *func, const char *loc,
|
||||
guint32 domain, guint32 level,
|
||||
const char *fmt, ...);
|
||||
|
||||
|
||||
gboolean nm_logging_setup (const char *level, const char *domains, GError **error);
|
||||
void nm_logging_start (gboolean become_daemon);
|
||||
void nm_logging_backtrace (void);
|
||||
void nm_logging_shutdown (void);
|
||||
|
||||
#endif /* NM_LOGGING_H */
|
||||
|
Reference in New Issue
Block a user