audio/cmd_utils - log the command before Popen.

So that we know which command went wrong in the log.

BUG=None
TEST=Run audiovideo_LineOutToMicrophone test on butterfly.

Change-Id: Ia2297e7d9b5d53695eb048fd7645e2e8f990408b
Reviewed-on: https://chromium-review.googlesource.com/178927
Reviewed-by: Owen Lin <owenlin@chromium.org>
Commit-Queue: Owen Lin <owenlin@chromium.org>
Tested-by: Owen Lin <owenlin@chromium.org>
diff --git a/client/cros/audio/cmd_utils.py b/client/cros/audio/cmd_utils.py
index d4b9ba4..9beda3f 100644
--- a/client/cros/audio/cmd_utils.py
+++ b/client/cros/audio/cmd_utils.py
@@ -63,9 +63,11 @@
     executed command stored in Popen.command.
     '''
     # The lock is required for http://crbug.com/323843.
+    the_args = args[0] if len(args) > 0 else kargs['args']
+    command = ' '.join(pipes.quote(x) for x in the_args)
+    logging.info('Running: %s', command)
     with _popen_lock:
         ps = subprocess.Popen(*args, **kargs)
-    the_args = args[0] if len(args) > 0 else kargs['args']
-    ps.command = ' '.join(pipes.quote(x) for x in the_args)
-    logging.info('Running(%d): %s', ps.pid, ps.command)
+    ps.command = command
+    logging.info('pid: %d', ps.pid)
     return ps