[elbe-devel] [PATCH v3 13/52] ASCIIDocLog compatible with new logging system
Olivier Dion
dion at linutronix.de
Fri Jul 5 12:10:41 CEST 2019
On 2019-07-05T10:53:09+0200, Torben Hohn wrote:
> > ---
> > elbepack/asciidoclog.py | 114 ++++++++++++------------------------------------
> > 1 file changed, 29 insertions(+), 85 deletions(-)
> >
> > diff --git a/elbepack/asciidoclog.py b/elbepack/asciidoclog.py
> > index ad899feb..bfbb3cda 100644
> > --- a/elbepack/asciidoclog.py
> > +++ b/elbepack/asciidoclog.py
> > @@ -7,117 +7,61 @@
> >
> > import os
> > import sys
> > +import logging
> > +
> > +from elbepack.shellhelper import get_command_out, do, chroot
> > +
> > +class CommandError(Exception):
> > + def __init__(self, cmd, returncode):
> > + Exception.__init__(self)
> > + self.returncode = returncode
> > + self.cmd = cmd
> > +
> > + def __repr__(self):
> > + return "Error: %d returned from Command %s" % (
> > + self.returncode, self.cmd)
> why are you duplicating CommandError here ?
> i dont understand.
No reason. It should import the one from shellhelper instead. I'll
remove this.
> >
> > -from elbepack.shellhelper import CommandError, command_out_stderr, command_out
> >
> >
> > class LogBase(object):
> > - def __init__(self, fp):
> > - self.fp = fp
> > + def __init__(self, *args, **kwargs):
> > + pass
> >
> > def printo(self, text=""):
> > - self.fp.write("%s\n" % str(text))
> > + logging.debug(text)
> hmm... not sure, if debug is the right level.
> lets use info, i think.
Sure
--
Olivier Dion
Linutronix GmbH | Bahnhofstrasse 3 | D-88690 Uhldingen-Mühlhofen
More information about the elbe-devel
mailing list