[elbe-devel] [PATCH v3 23/52] Add logging to stdout for command genlicense
Torben Hohn
torben.hohn at linutronix.de
Fri Jul 5 11:03:47 CEST 2019
On Thu, Jun 27, 2019 at 02:44:37PM +0200, dion at linutronix.de wrote:
> From: Olivier Dion <dion at linutronix.de>
make use of the new logging system, and replace all
print() with functions from logging and wrap
it in "with elbe_logging(stdout=True):"
>
> 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