]> git.proxmox.com Git - mirror_frr.git/commitdiff
lib: Remove extraneous spacing/output filter cmds
authorStephen Worley <sworley@cumulusnetworks.com>
Wed, 19 Jun 2019 15:47:38 +0000 (11:47 -0400)
committerStephen Worley <sworley@cumulusnetworks.com>
Wed, 19 Jun 2019 21:20:24 +0000 (17:20 -0400)
Use %% style for errors in log commands and switch
tabs to a single space in output. Also, remove un-needed
output for success.

Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
lib/log.c
lib/log_vty.c
vtysh/vtysh.c

index b46e6cb2caa6102a7696dc844a7f203540cf3cdb..732b238b1ee753c446d1e1b0131918c52c3eb82f 100644 (file)
--- a/lib/log.c
+++ b/lib/log.c
@@ -155,7 +155,7 @@ int zlog_filter_dump(char *buf, size_t max_size)
        int len = 0;
 
        for (int i = 0; i < zlog_filter_count; i++) {
-               ret = snprintf(buf + len, max_size - len, "\t%s\n",
+               ret = snprintf(buf + len, max_size - len, " %s\n",
                               zlog_filters[i]);
                len += ret;
                if ((ret < 0) || ((size_t)len >= max_size)) {
index a3fa08711eee9ce5dd2850c35896e3f004a2150a..68d598f5656d740a135668e78c685c25234b6d5c 100644 (file)
@@ -28,7 +28,6 @@
 #include "lib/log_vty_clippy.c"
 #endif
 
-/* Log filter */
 DEFPY (log_filter,
        log_filter_cmd,
        "[no] log-filter WORD$filter",
@@ -44,15 +43,15 @@ DEFPY (log_filter,
                ret = zlog_filter_add(filter);
 
        if (ret == 1) {
-               vty_out(vty, "\tfilter table full\n");
+               vty_out(vty, "%% filter table full\n");
                return CMD_WARNING;
        } else if (ret != 0) {
-               vty_out(vty, "\tfailed to %s log filter\n",
+               vty_out(vty, "%% failed to %s log filter\n",
                        (no ? "remove" : "apply"));
                return CMD_WARNING;
        }
 
-       vty_out(vty, "\t%s\n", filter);
+       vty_out(vty, " %s\n", filter);
        return CMD_SUCCESS;
 }
 
@@ -64,7 +63,6 @@ DEFPY (log_filter_clear,
        FILTER_LOG_STR)
 {
        zlog_filter_clear();
-       vty_out(vty, "\tcleared all filters\n");
        return CMD_SUCCESS;
 }
 
@@ -81,7 +79,7 @@ DEFPY (show_log_filter,
        len = zlog_filter_dump(log_filters, sizeof(log_filters));
 
        if (len == -1) {
-               vty_out(vty, "\tfailed to get filters\n");
+               vty_out(vty, "%% failed to get filters\n");
                return CMD_WARNING;
        }
 
index 804dc38b14e0c4d1a1acc52ddcfddf5f630e7b82..053848bfc31d1c056b3d145c8fa0b08fecc3b199 100644 (file)
@@ -2672,14 +2672,14 @@ DEFUN (vtysh_log_filter,
        idx = 1;
        found = argv_find(argv, argc, "WORD", &idx);
        if (found != 1) {
-               vty_out(vty, "No filter string given\n");
+               vty_out(vty, "%% No filter string given\n");
                return CMD_WARNING;
        }
        filter = argv[idx]->arg;
 
        if (strnlen(filter, ZLOG_FILTER_LENGTH_MAX + 1)
            > ZLOG_FILTER_LENGTH_MAX) {
-               vty_out(vty, "Filter is too long\n");
+               vty_out(vty, "%% Filter is too long\n");
                return CMD_WARNING;
        }
 
@@ -2687,7 +2687,7 @@ DEFUN (vtysh_log_filter,
                       filter);
 
        if ((len < 0) || (size_t)(total_len + len) > sizeof(line)) {
-               vty_out(vty, "Error buffering filter to daemons\n");
+               vty_out(vty, "%% Error buffering filter to daemons\n");
                return CMD_ERR_INCOMPLETE;
        }