[ovs-dev] vlog: Make "vlog/set" without args set everything to "dbg".
diff mbox

Message ID 1499669501-80363-4-git-send-email-jpettit@ovn.org
State Accepted
Headers show

Commit Message

Justin Pettit July 10, 2017, 6:51 a.m. UTC
The documentation stated that "ovs-appctl vlog/set" without any
arguments should set every module and destination to debug level.

Signed-off-by: Justin Pettit <jpettit@ovn.org>
---
 lib/vlog.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

Comments

Ben Pfaff July 14, 2017, 7:58 p.m. UTC | #1
On Sun, Jul 09, 2017 at 11:51:41PM -0700, Justin Pettit wrote:
> The documentation stated that "ovs-appctl vlog/set" without any
> arguments should set every module and destination to debug level.
> 
> Signed-off-by: Justin Pettit <jpettit@ovn.org>

Acked-by: Ben Pfaff <blp@ovn.org>
Justin Pettit July 15, 2017, 8:47 p.m. UTC | #2
> On Jul 14, 2017, at 12:58 PM, Ben Pfaff <blp@ovn.org> wrote:
> 
> On Sun, Jul 09, 2017 at 11:51:41PM -0700, Justin Pettit wrote:
>> The documentation stated that "ovs-appctl vlog/set" without any
>> arguments should set every module and destination to debug level.
>> 
>> Signed-off-by: Justin Pettit <jpettit@ovn.org>
> 
> Acked-by: Ben Pfaff <blp@ovn.org>

Thanks.  Pushed this to master.

--Justin

Patch
diff mbox

diff --git a/lib/vlog.c b/lib/vlog.c
index 333337b10d89..ce865b23ec75 100644
--- a/lib/vlog.c
+++ b/lib/vlog.c
@@ -631,6 +631,10 @@  vlog_unixctl_set(struct unixctl_conn *conn, int argc, const char *argv[],
 {
     int i;
 
+    /* With no argument, set all destinations and modules to "dbg". */
+    if (argc == 1) {
+        vlog_set_levels(NULL, VLF_ANY_DESTINATION, VLL_DBG);
+    }
     for (i = 1; i < argc; i++) {
         char *msg = vlog_set_levels_from_string(argv[i]);
         if (msg) {
@@ -791,7 +795,7 @@  vlog_init(void)
 
         unixctl_command_register(
             "vlog/set", "{spec | PATTERN:destination:pattern}",
-            1, INT_MAX, vlog_unixctl_set, NULL);
+            0, INT_MAX, vlog_unixctl_set, NULL);
         unixctl_command_register("vlog/list", "", 0, 0, vlog_unixctl_list,
                                  NULL);
         unixctl_command_register("vlog/list-pattern", "", 0, 0,