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

Torben Hohn torben.hohn at linutronix.de
Wed Jun 26 15:26:58 CEST 2019


On Fri, Jun 21, 2019 at 07:40:05PM +0200, dion at linutronix.de wrote:
> From: Olivier Dion <dion at linutronix.de>
> 
> Signed-off-by: Olivier Dion <dion at linutronix.de>

Reviewed-by: Torben Hohn <torben.hohn 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
> 
> 
> _______________________________________________
> elbe-devel mailing list
> elbe-devel at linutronix.de
> https://lists.linutronix.de/mailman/listinfo/elbe-devel

-- 
Torben Hohn
Linutronix GmbH | Bahnhofstrasse 3 | D-88690 Uhldingen-Mühlhofen
Phone: +49 7556 25 999 18; Fax.: +49 7556 25 999 99

Hinweise zum Datenschutz finden Sie hier (Informations on data privacy 
can be found here): https://linutronix.de/kontakt/Datenschutz.php

Linutronix GmbH | Firmensitz (Registered Office): Uhldingen-Mühlhofen | 
Registergericht (Registration Court): Amtsgericht Freiburg i.Br., HRB700 
806 | Geschäftsführer (Managing Directors): Heinz Egger, Thomas Gleixner



More information about the elbe-devel mailing list