mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-04-27 10:40:43 +02:00
logging: add 'DEFAULT' logging domain
It contains logging domains that are active by default. It allows users to set default domains back easily (after they changed them). And fix formatting of "} else if".
This commit is contained in:
parent
0309bdc2e0
commit
7b10b4d468
2 changed files with 16 additions and 10 deletions
|
|
@ -2,7 +2,7 @@
|
|||
.\"
|
||||
.\" Copyright (C) 2010 - 2012 Red Hat, Inc.
|
||||
.\"
|
||||
.TH "NetworkManager.conf" "5" "7 November 2012" ""
|
||||
.TH "NetworkManager.conf" "5" "18 December 2012" ""
|
||||
.SH NAME
|
||||
NetworkManager.conf \- NetworkManager configuration file
|
||||
.SH SYNOPSIS
|
||||
|
|
@ -162,13 +162,15 @@ DHCP6, PPP, WIFI_SCAN, IP4, IP6, AUTOIP4, DNS, VPN, SHARING, SUPPLICANT, AGENTS,
|
|||
SETTINGS, SUSPEND, CORE, DEVICE, OLPC, WIMAX, INFINIBAND, FIREWALL, ADSL, BOND,
|
||||
VLAN].
|
||||
.br
|
||||
In addition to them, these special domains can be used: [NONE, ALL, DHCP, IP].
|
||||
In addition to them, these special domains can be used: [NONE, ALL, DEFAULT, DHCP, IP].
|
||||
.PP
|
||||
.RS
|
||||
NONE = when given by itself, logging is disabled
|
||||
.br
|
||||
ALL = all log domains will be switched on
|
||||
.br
|
||||
DEFAULT = default log domains
|
||||
.br
|
||||
DHCP = a shortcut for "DHCP4, DHCP6"
|
||||
.br
|
||||
IP = a shortcut for "IP4, IP6"
|
||||
|
|
|
|||
|
|
@ -49,8 +49,10 @@
|
|||
LOGD_INFINIBAND | LOGD_FIREWALL | LOGD_ADSL | LOGD_BOND | \
|
||||
LOGD_VLAN)
|
||||
|
||||
#define LOGD_DEFAULT (LOGD_ALL & ~LOGD_WIFI_SCAN)
|
||||
|
||||
static guint32 log_level = LOGL_INFO | LOGL_WARN | LOGL_ERR;
|
||||
static guint32 log_domains = LOGD_ALL & ~LOGD_WIFI_SCAN;
|
||||
static guint32 log_domains = LOGD_DEFAULT;
|
||||
|
||||
typedef struct {
|
||||
guint32 num;
|
||||
|
|
@ -100,9 +102,10 @@ static const LogDesc domain_descs[] = {
|
|||
};
|
||||
|
||||
/* Combined domains */
|
||||
#define LOGD_ALL_STRING "ALL"
|
||||
#define LOGD_DHCP_STRING "DHCP"
|
||||
#define LOGD_IP_STRING "IP"
|
||||
#define LOGD_ALL_STRING "ALL"
|
||||
#define LOGD_DEFAULT_STRING "DEFAULT"
|
||||
#define LOGD_DHCP_STRING "DHCP"
|
||||
#define LOGD_IP_STRING "IP"
|
||||
|
||||
/************************************************************************/
|
||||
|
||||
|
|
@ -166,12 +169,13 @@ nm_logging_setup (const char *level, const char *domains, GError **error)
|
|||
if (!strcasecmp (*iter, LOGD_ALL_STRING)) {
|
||||
new_domains = LOGD_ALL;
|
||||
found = TRUE;
|
||||
} else
|
||||
if (!strcasecmp (*iter, LOGD_DHCP_STRING)) {
|
||||
} else if (!strcasecmp (*iter, LOGD_DEFAULT_STRING)) {
|
||||
new_domains = LOGD_DEFAULT;
|
||||
found = TRUE;
|
||||
} else if (!strcasecmp (*iter, LOGD_DHCP_STRING)) {
|
||||
new_domains |= LOGD_DHCP;
|
||||
found = TRUE;
|
||||
} else
|
||||
if (!strcasecmp (*iter, LOGD_IP_STRING)) {
|
||||
} else if (!strcasecmp (*iter, LOGD_IP_STRING)) {
|
||||
new_domains |= LOGD_IP;
|
||||
found = TRUE;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue