summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStephen Worley <sworley@cumulusnetworks.com>2019-06-19 11:47:38 -0400
committerStephen Worley <sworley@cumulusnetworks.com>2019-06-19 17:20:24 -0400
commit8ad7c5c2e714e8f987e6920f924534f289758684 (patch)
tree3b783978882f8ae106bc90ec6a8d87314d040503
parentec1d97751ed505f1a938d509a5c0171f64efc60d (diff)
lib: Remove extraneous spacing/output filter cmds
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>
-rw-r--r--lib/log.c2
-rw-r--r--lib/log_vty.c10
-rw-r--r--vtysh/vtysh.c6
3 files changed, 8 insertions, 10 deletions
diff --git a/lib/log.c b/lib/log.c
index b46e6cb2ca..732b238b1e 100644
--- 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)) {
diff --git a/lib/log_vty.c b/lib/log_vty.c
index a3fa08711e..68d598f565 100644
--- a/lib/log_vty.c
+++ b/lib/log_vty.c
@@ -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;
}
diff --git a/vtysh/vtysh.c b/vtysh/vtysh.c
index 804dc38b14..053848bfc3 100644
--- a/vtysh/vtysh.c
+++ b/vtysh/vtysh.c
@@ -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;
}