]>
git.proxmox.com Git - mirror_frr.git/blob - lib/log_vty.c
3 * Copyright (C) 2019 Cumulus Networks, Inc.
6 * This program is free software; you can redistribute it and/or modify it
7 * under the terms of the GNU General Public License as published by the Free
8 * Software Foundation; either version 2 of the License, or (at your option)
11 * This program is distributed in the hope that it will be useful, but WITHOUT
12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
16 * You should have received a copy of the GNU General Public License along
17 * with this program; see the file COPYING; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
23 #include "lib/log_vty.h"
27 #ifndef VTYSH_EXTRACT_PL
28 #include "lib/log_vty_clippy.c"
33 "[no] log-filter WORD$filter",
36 "String to filter by\n")
41 ret
= zlog_filter_del(filter
);
43 ret
= zlog_filter_add(filter
);
46 vty_out(vty
, "%% filter table full\n");
48 } else if (ret
!= 0) {
49 vty_out(vty
, "%% failed to %s log filter\n",
50 (no
? "remove" : "apply"));
54 vty_out(vty
, " %s\n", filter
);
58 /* Clear all log filters */
59 DEFPY (log_filter_clear
,
70 DEFPY (show_log_filter
,
76 char log_filters
[ZLOG_FILTERS_MAX
* (ZLOG_FILTER_LENGTH_MAX
+ 3)] = "";
79 len
= zlog_filter_dump(log_filters
, sizeof(log_filters
));
82 vty_out(vty
, "%% failed to get filters\n");
87 vty_out(vty
, "%s", log_filters
);
92 void log_filter_cmd_init(void)
94 install_element(VIEW_NODE
, &show_log_filter_cmd
);
95 install_element(CONFIG_NODE
, &log_filter_cmd
);
96 install_element(CONFIG_NODE
, &log_filter_clear_cmd
);