From: David Lamparter Date: Tue, 24 Mar 2020 18:15:04 +0000 (+0100) Subject: *: remove line breaks from log messages X-Git-Tag: base_7.4~171^2~1 X-Git-Url: https://git.puffer.fish/?a=commitdiff_plain;h=63efca0e95c727318485fe6d37141f79b1401a88;p=matthieu%2Ffrr.git *: remove line breaks from log messages Line break at the end of the message is implicit for zlog_* and flog_*, don't put it in the string. Mid-message line breaks are currently unsupported. (LF is "end of message" in syslog.) Signed-off-by: David Lamparter --- diff --git a/bgpd/bgp_bmp.c b/bgpd/bgp_bmp.c index 32865da376..65a032abd5 100644 --- a/bgpd/bgp_bmp.c +++ b/bgpd/bgp_bmp.c @@ -385,15 +385,15 @@ static struct stream *bmp_peerstate(struct peer *peer, bool down) stream_put(s, bbpeer->open_tx, bbpeer->open_tx_len); else { stream_put(s, dummy_open, sizeof(dummy_open)); - zlog_warn("bmp: missing TX OPEN message for peer %s\n", - peer->host); + zlog_warn("bmp: missing TX OPEN message for peer %s", + peer->host); } if (bbpeer && bbpeer->open_rx) stream_put(s, bbpeer->open_rx, bbpeer->open_rx_len); else { stream_put(s, dummy_open, sizeof(dummy_open)); - zlog_warn("bmp: missing RX OPEN message for peer %s\n", - peer->host); + zlog_warn("bmp: missing RX OPEN message for peer %s", + peer->host); } if (peer->desc) @@ -1342,8 +1342,7 @@ static int bmp_accept(struct thread *thread) /* We can handle IPv4 or IPv6 socket. */ bmp_sock = sockunion_accept(bl->sock, &su); if (bmp_sock < 0) { - zlog_info("bmp: accept_sock failed: %s\n", - safe_strerror (errno)); + zlog_info("bmp: accept_sock failed: %s", safe_strerror(errno)); return -1; } bmp_open(bl->targets, bmp_sock); diff --git a/bgpd/bgp_route.c b/bgpd/bgp_route.c index 1bd5780a20..a56549a113 100644 --- a/bgpd/bgp_route.c +++ b/bgpd/bgp_route.c @@ -6845,7 +6845,7 @@ static int bgp_aggregate_set(struct vty *vty, const char *prefix_str, afi_t afi, if (as_set == AGGREGATE_AS_SET) { as_set_new = AGGREGATE_AS_UNSET; zlog_warn( - "%s: Ignoring as-set because `bgp reject-as-sets` is enabled.\n", + "%s: Ignoring as-set because `bgp reject-as-sets` is enabled.", __func__); vty_out(vty, "Ignoring as-set because `bgp reject-as-sets` is enabled.\n"); diff --git a/isisd/isis_adjacency.c b/isisd/isis_adjacency.c index 1d70521e68..9beed206e8 100644 --- a/isisd/isis_adjacency.c +++ b/isisd/isis_adjacency.c @@ -353,7 +353,7 @@ void isis_adj_print(struct isis_adjacency *adj) if (dyn) zlog_debug("%s", dyn->hostname); - zlog_debug("SystemId %20s SNPA %s, level %d\nHolding Time %d", + zlog_debug("SystemId %20s SNPA %s, level %d; Holding Time %d", sysid_print(adj->sysid), snpa_print(adj->snpa), adj->level, adj->hold_time); if (adj->ipv4_address_count) { diff --git a/ospfd/ospf_ase.c b/ospfd/ospf_ase.c index 2c80d485a3..30940cf010 100644 --- a/ospfd/ospf_ase.c +++ b/ospfd/ospf_ase.c @@ -691,7 +691,7 @@ static int ospf_ase_calculate_timer(struct thread *t) if (IS_DEBUG_OSPF_EVENT) zlog_info( - "SPF Processing Time(usecs): External Routes: %lld\n", + "SPF Processing Time(usecs): External Routes: %lld", (stop_time.tv_sec - start_time.tv_sec) * 1000000LL + (stop_time.tv_usec diff --git a/ospfd/ospf_lsa.c b/ospfd/ospf_lsa.c index 55ec638522..d50f390e30 100644 --- a/ospfd/ospf_lsa.c +++ b/ospfd/ospf_lsa.c @@ -2805,7 +2805,7 @@ static int ospf_maxage_lsa_remover(struct thread *thread) if (CHECK_FLAG(lsa->flags, OSPF_LSA_PREMATURE_AGE)) { if (IS_DEBUG_OSPF(lsa, LSA_FLOODING)) zlog_debug( - "originating new lsa for lsa 0x%p\n", + "originating new lsa for lsa 0x%p", (void *)lsa); ospf_lsa_refresh(ospf, lsa); } diff --git a/ospfd/ospf_packet.c b/ospfd/ospf_packet.c index 0808f245e2..aa50aeacbc 100644 --- a/ospfd/ospf_packet.c +++ b/ospfd/ospf_packet.c @@ -611,7 +611,7 @@ static void ospf_write_frags(int fd, struct ospf_packet *op, struct ip *iph, if (IS_DEBUG_OSPF_PACKET(type - 1, SEND)) { zlog_debug( - "ospf_write_frags: sent id %d, off %d, len %d to %s\n", + "ospf_write_frags: sent id %d, off %d, len %d to %s", iph->ip_id, iph->ip_off, iph->ip_len, inet_ntoa(iph->ip_dst)); } diff --git a/ospfd/ospf_ri.c b/ospfd/ospf_ri.c index 5f01edfbdf..fbe513cea0 100644 --- a/ospfd/ospf_ri.c +++ b/ospfd/ospf_ri.c @@ -1382,9 +1382,8 @@ static uint16_t show_vty_sr_algorithm(struct vty *vty, struct tlv_header *tlvh) zlog_debug(" Algorithm %d: Strict SPF", i); break; default: - zlog_debug( - " Algorithm %d: Unknown value %d\n", - i, algo->value[i]); + zlog_debug(" Algorithm %d: Unknown value %d", + i, algo->value[i]); break; } } diff --git a/pimd/pim_bsm.c b/pimd/pim_bsm.c index f55934909a..ad47427101 100644 --- a/pimd/pim_bsm.c +++ b/pimd/pim_bsm.c @@ -1068,13 +1068,13 @@ static bool pim_install_bsm_grp_rp(struct pim_instance *pim, if (listnode_add_sort_nodup(grpnode->partial_bsrp_list, bsm_rpinfo)) { if (PIM_DEBUG_BSM) zlog_debug( - "%s, bs_rpinfo node added to the partial bs_rplist.\r\n", + "%s, bs_rpinfo node added to the partial bs_rplist.", __func__); return true; } if (PIM_DEBUG_BSM) - zlog_debug("%s: list node not added\n", __func__); + zlog_debug("%s: list node not added", __func__); XFREE(MTYPE_PIM_BSRP_NODE, bsm_rpinfo); return false; @@ -1092,7 +1092,7 @@ static void pim_update_pending_rp_cnt(struct bsm_scope *sz, if (bsm_frag_tag != bsgrp->frag_tag) { if (PIM_DEBUG_BSM) zlog_debug( - "%s,Received a new BSM ,so clear the pending bs_rpinfo list.\r\n", + "%s,Received a new BSM ,so clear the pending bs_rpinfo list.", __func__); list_delete_all_node(bsgrp->partial_bsrp_list); bsgrp->pend_rp_cnt = total_rp_count; @@ -1132,7 +1132,7 @@ static bool pim_bsm_parse_install_g2rp(struct bsm_scope *scope, uint8_t *buf, pim_inet4_dump("", grpinfo.group.addr, grp_str, sizeof(grp_str)); zlog_debug( - "%s, Group %s Rpcount:%d Fragment-Rp-count:%d\r\n", + "%s, Group %s Rpcount:%d Fragment-Rp-count:%d", __func__, grp_str, grpinfo.rp_count, grpinfo.frag_rp_count); } @@ -1146,9 +1146,8 @@ static bool pim_bsm_parse_install_g2rp(struct bsm_scope *scope, uint8_t *buf, pim_inet4_dump("", grpinfo.group.addr, grp_str, sizeof(grp_str)); - zlog_debug( - "%s, Rp count is zero for group: %s\r\n", - __func__, grp_str); + zlog_debug("%s, Rp count is zero for group: %s", + __func__, grp_str); } return false; } @@ -1169,9 +1168,8 @@ static bool pim_bsm_parse_install_g2rp(struct bsm_scope *scope, uint8_t *buf, if (!bsgrp) { if (PIM_DEBUG_BSM) - zlog_debug( - "%s, Create new BSM Group node.\r\n", - __func__); + zlog_debug("%s, Create new BSM Group node.", + __func__); /* create a new node to be added to the tree. */ bsgrp = pim_bsm_new_bsgrp_node(scope->bsrp_table, @@ -1179,7 +1177,7 @@ static bool pim_bsm_parse_install_g2rp(struct bsm_scope *scope, uint8_t *buf, if (!bsgrp) { zlog_debug( - "%s, Failed to get the BSM group node.\r\n", + "%s, Failed to get the BSM group node.", __func__); continue; } @@ -1214,7 +1212,7 @@ static bool pim_bsm_parse_install_g2rp(struct bsm_scope *scope, uint8_t *buf, pim_inet4_dump("", rpinfo.rpaddr.addr, rp_str, sizeof(rp_str)); zlog_debug( - "%s, Rp address - %s; pri:%d hold:%d\r\n", + "%s, Rp address - %s; pri:%d hold:%d", __func__, rp_str, rpinfo.rp_pri, rpinfo.rp_holdtime); } @@ -1378,7 +1376,7 @@ int pim_bsm_process(struct interface *ifp, struct ip *ip_hdr, uint8_t *buf, (buf_size - PIM_BSM_HDR_LEN - PIM_MSG_HEADER_LEN), frag_tag)) { if (PIM_DEBUG_BSM) { - zlog_debug("%s, Parsing BSM failed.\r\n", __func__); + zlog_debug("%s, Parsing BSM failed.", __func__); } pim->bsm_dropped++; return -1; diff --git a/pimd/pim_register.c b/pimd/pim_register.c index 7b0af89993..cb6aae7fae 100644 --- a/pimd/pim_register.c +++ b/pimd/pim_register.c @@ -186,7 +186,7 @@ void pim_register_send(const uint8_t *buf, int buf_size, struct in_addr src, if (!pinfo) { if (PIM_DEBUG_PIM_REG) zlog_debug( - "%s: Interface: %s not configured for pim to trasmit on!\n", + "%s: Interface: %s not configured for pim to transmit on!", __func__, ifp->name); return; } diff --git a/zebra/kernel_socket.c b/zebra/kernel_socket.c index 5ab5210664..950690b943 100644 --- a/zebra/kernel_socket.c +++ b/zebra/kernel_socket.c @@ -1393,7 +1393,7 @@ static int kernel_read(struct thread *thread) */ if (rtm->rtm_msglen != nbytes) { zlog_debug( - "kernel_read: rtm->rtm_msglen %d, nbytes %d, type %d\n", + "kernel_read: rtm->rtm_msglen %d, nbytes %d, type %d", rtm->rtm_msglen, nbytes, rtm->rtm_type); return -1; } diff --git a/zebra/zapi_msg.c b/zebra/zapi_msg.c index f1c181438e..c0882c3f35 100644 --- a/zebra/zapi_msg.c +++ b/zebra/zapi_msg.c @@ -1063,7 +1063,7 @@ static void zread_rnh_register(ZAPI_HANDLER_ARGS) if (IS_ZEBRA_DEBUG_NHT) zlog_debug( - "rnh_register msg from client %s: hdr->length=%d, type=%s vrf=%u\n", + "rnh_register msg from client %s: hdr->length=%d, type=%s vrf=%u", zebra_route_string(client->proto), hdr->length, (type == RNH_NEXTHOP_TYPE) ? "nexthop" : "route", zvrf->vrf->vrf_id); @@ -1152,7 +1152,7 @@ static void zread_rnh_unregister(ZAPI_HANDLER_ARGS) if (IS_ZEBRA_DEBUG_NHT) zlog_debug( - "rnh_unregister msg from client %s: hdr->length=%d vrf: %u\n", + "rnh_unregister msg from client %s: hdr->length=%d vrf: %u", zebra_route_string(client->proto), hdr->length, zvrf->vrf->vrf_id);