[elbe-devel] [PATCH v2 13/28] Add logging to stdout for command genlicense

dion at linutronix.de dion at linutronix.de
Fri Jun 21 19:40:05 CEST 2019


From: Olivier Dion <dion at linutronix.de>

Signed-off-by: Olivier Dion <dion at linutronix.de>
---
 elbepack/commands/genlicence.py | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/elbepack/commands/genlicence.py b/elbepack/commands/genlicence.py
index 40f9805b..63798d60 100644
--- a/elbepack/commands/genlicence.py
+++ b/elbepack/commands/genlicence.py
@@ -11,8 +11,8 @@ import sys
 import os
 import io
 
-from elbepack.asciidoclog import StdoutLog
 from elbepack.efilesystem import ElbeFilesystem
+from elbepack.log import elbe_logging
 
 
 def run_command(argv):
@@ -31,13 +31,13 @@ def run_command(argv):
 
     chroot = os.path.abspath(args[0])
 
-    rfs = ElbeFilesystem(chroot)
-    log = StdoutLog()
+    with elbe_logging(stdout=True):
+        rfs = ElbeFilesystem(chroot)
 
-    if opt.output:
-        f = io.open(opt.output, "w+", encoding='utf-8')
-    else:
-        f = io.open('licence.txt', "w+", encoding='utf-8')
+        if opt.output:
+            f = io.open(opt.output, "w+", encoding='utf-8')
+        else:
+            f = io.open('licence.txt', "w+", encoding='utf-8')
 
-    rfs.write_licenses(f, log, opt.xml)
-    f.close()
+        rfs.write_licenses(f, log, opt.xml)
+        f.close()
-- 
2.11.0




More information about the elbe-devel mailing list