NetworkManager/src/logging/nm-logging.h

109 lines
3.5 KiB
C
Raw Normal View History

/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */
/* NetworkManager -- Network link manager
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* 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 - 2010 Red Hat, Inc.
* Copyright (C) 2006 - 2008 Novell, Inc.
*/
#ifndef NM_LOGGING_H
#define NM_LOGGING_H
#include <glib.h>
#include <glib-object.h>
/* Log domains */
enum {
LOGD_NONE = 0x00000000,
2010-04-07 10:55:30 -07:00
LOGD_HW = 0x00000001, /* Hardware detection and info */
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,
2010-04-07 10:55:30 -07:00
LOGD_SHARING = 0x00008000, /* Connection sharing/dnsmasq */
LOGD_SUPPLICANT = 0x00010000, /* WiFi and 802.1x */
LOGD_USER_SET = 0x00020000, /* User settings */
LOGD_SYS_SET = 0x00040000, /* System settings */
LOGD_SUSPEND = 0x00080000, /* Suspend/Resume */
LOGD_CORE = 0x00100000, /* Core daemon and policy stuff */
2010-04-06 16:25:42 -07:00
LOGD_DEVICE = 0x00200000, /* Device state and activation */
2010-04-07 11:13:25 -07:00
LOGD_OLPC_MESH = 0x00400000,
};
2010-04-06 18:06:36 -07:00
#define LOGD_DHCP (LOGD_DHCP4 | LOGD_DHCP6)
/* Log levels */
enum {
LOGL_ERR = 0x00000000,
LOGL_WARN = 0x00000001,
LOGL_INFO = 0x00000002,
LOGL_DEBUG = 0x00000004
};
#define NM_LOGGING_ERROR (nm_logging_error_quark ())
#define NM_TYPE_LOGGING_ERROR (nm_logging_error_get_type ())
GQuark nm_logging_error_quark (void);
GType nm_logging_error_get_type (void);
2010-04-06 15:46:03 -07:00
#define nm_log_err(domain, fmt, args...) \
2010-04-07 13:40:27 -07:00
{ _nm_log (G_STRLOC, G_STRFUNC, domain, LOGL_ERR, fmt, ##args); }
2010-04-06 15:46:03 -07:00
#define nm_log_warn(domain, fmt, args...) \
2010-04-07 13:40:27 -07:00
{ _nm_log (G_STRLOC, G_STRFUNC, domain, LOGL_WARN, fmt, ##args); }
2010-04-06 15:46:03 -07:00
#define nm_log_info(domain, fmt, args...) \
2010-04-07 13:40:27 -07:00
{ _nm_log (G_STRLOC, G_STRFUNC, domain, LOGL_INFO, fmt, ##args); }
2010-04-06 15:46:03 -07:00
#define nm_log_dbg(domain, fmt, args...) \
2010-04-07 13:40:27 -07:00
{ _nm_log (G_STRLOC, G_STRFUNC, domain, LOGL_DEBUG, fmt, ##args); }
2010-04-06 15:46:03 -07:00
#define nm_log(domain, level, fmt, args...) \
2010-04-07 13:40:27 -07:00
{ _nm_log (G_STRLOC, G_STRFUNC, domain, level, fmt, ##args); }
2010-04-07 13:40:27 -07:00
void _nm_log (const char *loc, const char *func,
guint32 domain, guint32 level,
const char *fmt, ...);
/* Undefine the nm-utils.h logging stuff to ensure errors */
#undef nm_print_backtrace
#undef nm_get_timestamp
#undef nm_info
#undef nm_info_str
#undef nm_debug
#undef nm_debug_str
#undef nm_warning
#undef nm_warning_str
#undef nm_error
#undef nm_error_str
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);
2007-02-19 Tambet Ingo <tambet@ximian.com> * src/vpn-manager/nm-vpn-manager.c: Handle the DBUS state changes itself. Handle device state changes and disconnect VPN if it's device deactivates. * src/nm-dbus-nm.c: * src/nm-dbus-nm.h: * src/nm-dbus-device.c: * src/nm-dbus-device.c: * src/nm-dbus-net.c: * src/nm-dbus-net.h: Remove. All of it is implemented byt the new dbus API. * src/NetworkManagerMain.h: Get rid of all but 3 properties of NMData. * src/nm-device.c (nm_device_get_by_udi): (nm_device_get_by_iface): Remove. This doesn't belong here and is already implemented in the correct location (NMManager). Rip out all the test_device stuff. * src/NetworkManagerPolicy.c: Remove the leftover activation success and failure handlers, it's all done by NMDevice already. * src/NetworkManager.c: Move the signal handling here from nm-logging.c Remove the iochannel hack to route the unix signals to the main thread since we're not threaded anymore. * src/NetworkManagerAP.c: Implement HWAddress property. * src/NetworkManagerDbus.c: Remove the dbus signal sending code, it happens automatically with dbus-glib. * src/nm-netlink-monitor.c: * src/nm-netlink-monitor.h: - Move it low in the class hierarchy, don't reference any NM types. - Remove private data from the header. - Use type safe checks in public API methods. - Make it a singleton so we don't have to pass the single reference around. git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@2339 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2007-02-19 13:09:32 +00:00
#endif /* NM_LOGGING_H */