diff mbox series

[ovs-dev] ovs-vtep: Pass log level arguments to underlying utils.

Message ID 1533138862-6223-1-git-send-email-i.maximets@samsung.com
State Accepted
Headers show
Series [ovs-dev] ovs-vtep: Pass log level arguments to underlying utils. | expand

Commit Message

Ilya Maximets Aug. 1, 2018, 3:54 p.m. UTC
Control utils should be called with the same verbose level
at least to manage output to system logs. For example, to
disable unwanted syslog messages in unit tests or to enable
higher debug levels if needed.
New arguments added before '-vconsole:off' because it's
still incovinient to have console output.

Signed-off-by: Ilya Maximets <i.maximets@samsung.com>
---

This could be a part of syslog clean up patch-set [1], but it looks
more like a separate independent feature.

[1] https://mail.openvswitch.org/pipermail/ovs-dev/2018-August/350425.html

 vtep/ovs-vtep.in | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

Comments

Ilya Maximets Aug. 1, 2018, 4 p.m. UTC | #1
On 01.08.2018 18:54, Ilya Maximets wrote:
> Control utils should be called with the same verbose level
> at least to manage output to system logs. For example, to
> disable unwanted syslog messages in unit tests or to enable
> higher debug levels if needed.
> New arguments added before '-vconsole:off' because it's
> still incovinient to have console output.

s/incovinient/inconvenient/

> 
> Signed-off-by: Ilya Maximets <i.maximets@samsung.com>
> ---
> 
> This could be a part of syslog clean up patch-set [1], but it looks
> more like a separate independent feature.
> 
> [1] https://mail.openvswitch.org/pipermail/ovs-dev/2018-August/350425.html
> 
>  vtep/ovs-vtep.in | 7 ++++++-
>  1 file changed, 6 insertions(+), 1 deletion(-)
> 
> diff --git a/vtep/ovs-vtep.in b/vtep/ovs-vtep.in
> index 98748e4..3383870 100755
> --- a/vtep/ovs-vtep.in
> +++ b/vtep/ovs-vtep.in
> @@ -39,6 +39,7 @@ root_prefix = ""
>  
>  __pychecker__ = 'no-reuseattr'  # Remove in pychecker >= 0.8.19.
>  vlog = ovs.vlog.Vlog("ovs-vtep")
> +verbose_args = []
>  exiting = False
>  
>  ps_name = ""
> @@ -53,7 +54,7 @@ bfd_ref = {}
>  
>  
>  def call_prog(prog, args_list):
> -    cmd = [prog, "-vconsole:off"] + args_list
> +    cmd = [prog] + verbose_args + ["-vconsole:off"] + args_list
>      creationFlags = 0
>      if sys.platform == 'win32':
>          creationFlags = 0x08000000  # CREATE_NO_WINDOW
> @@ -728,6 +729,10 @@ def main():
>      global ps_name
>      ps_name = args.ps_name
>  
> +    global verbose_args
> +    if args.verbose:
> +        verbose_args = ['-v' + arg for arg in args.verbose]
> +
>      ovs.daemon.daemonize()
>  
>      ovs.unixctl.command_register("exit", "", 0, 0, unixctl_exit, None)
>
Ben Pfaff Aug. 6, 2018, 11:50 p.m. UTC | #2
On Wed, Aug 01, 2018 at 06:54:22PM +0300, Ilya Maximets wrote:
> Control utils should be called with the same verbose level
> at least to manage output to system logs. For example, to
> disable unwanted syslog messages in unit tests or to enable
> higher debug levels if needed.
> New arguments added before '-vconsole:off' because it's
> still incovinient to have console output.
> 
> Signed-off-by: Ilya Maximets <i.maximets@samsung.com>
> ---
> 
> This could be a part of syslog clean up patch-set [1], but it looks
> more like a separate independent feature.
> 
> [1] https://mail.openvswitch.org/pipermail/ovs-dev/2018-August/350425.html

Applied to master, thanks.
diff mbox series

Patch

diff --git a/vtep/ovs-vtep.in b/vtep/ovs-vtep.in
index 98748e4..3383870 100755
--- a/vtep/ovs-vtep.in
+++ b/vtep/ovs-vtep.in
@@ -39,6 +39,7 @@  root_prefix = ""
 
 __pychecker__ = 'no-reuseattr'  # Remove in pychecker >= 0.8.19.
 vlog = ovs.vlog.Vlog("ovs-vtep")
+verbose_args = []
 exiting = False
 
 ps_name = ""
@@ -53,7 +54,7 @@  bfd_ref = {}
 
 
 def call_prog(prog, args_list):
-    cmd = [prog, "-vconsole:off"] + args_list
+    cmd = [prog] + verbose_args + ["-vconsole:off"] + args_list
     creationFlags = 0
     if sys.platform == 'win32':
         creationFlags = 0x08000000  # CREATE_NO_WINDOW
@@ -728,6 +729,10 @@  def main():
     global ps_name
     ps_name = args.ps_name
 
+    global verbose_args
+    if args.verbose:
+        verbose_args = ['-v' + arg for arg in args.verbose]
+
     ovs.daemon.daemonize()
 
     ovs.unixctl.command_register("exit", "", 0, 0, unixctl_exit, None)