Skip to content

Commit

Permalink
Use ni_log_facility instead of referencing ni_debug
Browse files Browse the repository at this point in the history
Signed-off-by: Olaf Hering <olaf@aepfle.de>
  • Loading branch information
olafhering committed Sep 2, 2014
1 parent 3a10b4b commit ef176c6
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion dhcp4/device.c
Expand Up @@ -307,7 +307,7 @@ ni_dhcp4_acquire(ni_dhcp4_device_t *dev, const ni_dhcp4_request_t *info)
config->doflags = DHCP4_DO_DEFAULT;
config->doflags |= ni_dhcp4_do_bits(info->update);

if (ni_debug & NI_TRACE_DHCP) {
if (ni_log_facility(NI_TRACE_DHCP)) {
ni_trace("Received request:");
ni_trace(" acquire-timeout %u", config->acquire_timeout);
ni_trace(" lease-time %u", config->max_lease_time);
Expand Down
6 changes: 3 additions & 3 deletions src/fsm.c
Expand Up @@ -1145,7 +1145,7 @@ ni_ifworker_print_callbacks(const char *ifname, ni_objectmodel_callback_info_t *
{
ni_objectmodel_callback_info_t *cb;

if (!(ni_debug & NI_TRACE_EVENTS))
if (!ni_log_facility(NI_TRACE_EVENTS))
return;

if (callback_list == NULL) {
Expand Down Expand Up @@ -2820,7 +2820,7 @@ ni_fsm_build_hierarchy(ni_fsm_t *fsm, ni_bool_t destructive)
}
}

if (ni_debug & NI_TRACE_APPLICATION) {
if (ni_log_facility(NI_TRACE_APPLICATION)) {
for (i = 0; i < fsm->workers.count; ++i) {
ni_ifworker_t *w = fsm->workers.data[i];

Expand Down Expand Up @@ -4023,7 +4023,7 @@ ni_fsm_schedule_bind_methods(ni_fsm_t *fsm, ni_ifworker_t *w)

if (!action->bound)
unbound++;
else if (ni_debug & NI_TRACE_APPLICATION)
else if (ni_log_facility(NI_TRACE_APPLICATION))
ni_ifworker_print_binding(w, action);
}

Expand Down
2 changes: 1 addition & 1 deletion src/ifevent.c
Expand Up @@ -500,7 +500,7 @@ __ni_rtevent_process_rdnss_info(ni_netdev_t *dev, const struct nd_opt_hdr *opt,

ni_ipv6_ra_rdnss_add_server(ipv6->radv.rdnss, addr);

if (ni_debug & NI_TRACE_EVENTS) {
if (ni_log_facility(NI_TRACE_EVENTS)) {
const ni_sockaddr_array_t *addrs = &ipv6->radv.rdnss->addrs;

ni_debug_events("%s: rdnss address: %s", dev->name,
Expand Down
2 changes: 1 addition & 1 deletion src/iflist.c
Expand Up @@ -1793,7 +1793,7 @@ __ni_rtnl_parse_newaddr(unsigned ifflags, struct nlmsghdr *h, struct ifaddrmsg *
ap->scope = ifa->ifa_scope;
ap->flags = ifa->ifa_flags;

if (ni_log_level_at(NI_LOG_DEBUG3) && (ni_debug & NI_TRACE_EVENTS)) {
if (ni_log_level_at(NI_LOG_DEBUG3) && (ni_log_facility(NI_TRACE_EVENTS))) {
ni_trace("newaddr(%s): family %d, prefixlen %u, scope %u, flags %u",
(ifflags & NI_IFF_POINT_TO_POINT) ? "ptp" : "brd",
ap->family, ap->prefixlen, ap->scope, ap->flags);
Expand Down
2 changes: 1 addition & 1 deletion src/sysfs.c
Expand Up @@ -358,7 +358,7 @@ ni_sysfs_bonding_set_list_attr(const char *ifname, const char *attr_name, const
goto done;
}

if (ni_debug & NI_TRACE_IFCONFIG) {
if (ni_log_facility(NI_TRACE_IFCONFIG)) {
ni_trace("%s: updating attr list %s", ifname, attr_name);
for (i = 0; i < delete.count; ++i)
ni_trace(" remove %s", delete.data[i]);
Expand Down
2 changes: 1 addition & 1 deletion src/xml-writer.c
Expand Up @@ -252,7 +252,7 @@ static void
xml_node_trace_printer(const char *line, void *user_data)
{
if (user_data == NULL
|| (ni_debug & *(unsigned int *) user_data) != 0)
|| ni_log_facility(*(unsigned int *) user_data) != 0)
ni_trace("%s", line);
}

Expand Down

0 comments on commit ef176c6

Please sign in to comment.