[elbe-devel] [PATCH v3 24/52] Add logging to opt.output for command hdimg

Torben Hohn torben.hohn at linutronix.de
Fri Jul 5 11:05:49 CEST 2019


On Thu, Jun 27, 2019 at 02:44:38PM +0200, dion at linutronix.de wrote:
> From: Olivier Dion <dion at linutronix.de>
> 
> Signed-off-by: Olivier Dion <dion at linutronix.de>
> ---
>  elbepack/commands/hdimg.py | 22 +++++++++++++---------
>  1 file changed, 13 insertions(+), 9 deletions(-)
> 
> diff --git a/elbepack/commands/hdimg.py b/elbepack/commands/hdimg.py
> index 85111b5c..cf3d96b6 100644
> --- a/elbepack/commands/hdimg.py
> +++ b/elbepack/commands/hdimg.py
> @@ -8,11 +8,14 @@
>  from __future__ import print_function
>  
>  import sys
> +import os
> +import logging
>  
>  from optparse import OptionParser
>  
>  from elbepack.elbeproject import ElbeProject
>  from elbepack.elbexml import ValidationError
> +from elbepack.log import elbe_logging
>  
>  
>  def run_command(argv):
> @@ -64,13 +67,14 @@ def run_command(argv):
>          oparser.print_help()
>          sys.exit(20)
>  
> -    try:
> -        project = ElbeProject(opt.target, override_buildtype=opt.buildtype,
> -                              xmlpath=args[0], logpath=opt.output,
> -                              skip_validate=opt.skip_validation)
> -    except ValidationError as e:
> -        print(str(e))
> -        print("xml validation failed. Bailing out")
> -        sys.exit(20)
> +    with elbe_logging(opt.target):

this logs to target, but it should be logging to opt.output, shouldnt it
?

> +        try:
> +            project = ElbeProject(opt.target,
> +                                  override_buildtype=opt.buildtype,
> +                                  xmlpath=args[0], logpath=opt.output,
> +                                  skip_validate=opt.skip_validation)

logpath ? isnt this attribute removed ?

> +        except ValidationError:
> +            logging.exception("XML validation failed.  Bailing out")
> +            sys.exit(20)
>  
> -    project.targetfs.part_target(opt.target, opt.grub_version)
> +        project.targetfs.part_target(opt.target, opt.grub_version)
> -- 
> 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