All of lore.kernel.org
 help / color / mirror / Atom feed
From: Richard Purdie <richard.purdie@linuxfoundation.org>
To: Christopher Larson <clarson@kergoth.com>
Cc: bitbake-devel <bitbake-devel@lists.openembedded.org>
Subject: Re: [PATCH] tests/data: Add log parsing test code
Date: Wed, 27 May 2015 17:34:15 +0100	[thread overview]
Message-ID: <1432744455.404.53.camel@linuxfoundation.org> (raw)
In-Reply-To: <CABcZAN=t4OFiwpAYT+CD8heNJVZO4s=Y3XOqxkqRvoakTSx=bQ@mail.gmail.com>

On Tue, 2015-05-26 at 08:26 -0700, Christopher Larson wrote:
> 
> On Tue, May 26, 2015 at 8:17 AM, Richard Purdie
> <richard.purdie@linuxfoundation.org> wrote:
>         +class LogRecord():
>         +    def __enter__(self):
>         +        import logging
>         +        logs = []
>         +        class LogHandler(logging.Handler):
>         +            def emit(self, record):
>         +                logs.append(record)
>         +
>         +        logger = logging.getLogger("BitBake")
>         +        handler = LogHandler()
>         +        logger.addHandler(handler)
>         +        return logs
>         +    def __exit__(self, type, value, traceback):
>         +        return
> 
> I realize it probably doesn’t matter in the testing case specifically,
> but this lies to the user of the class. Using a context manager that
> doesn’t undo what it’s done on exit.. :)

Er, yes, quite. I knew there was something I'd meant to go back and do
once it worked. I've posted a v2 with that fixed.

Cheers,

Richard




  reply	other threads:[~2015-05-27 16:34 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-26 15:17 [PATCH] tests/data: Add log parsing test code Richard Purdie
2015-05-26 15:26 ` Christopher Larson
2015-05-27 16:34   ` Richard Purdie [this message]
2015-05-27 16:52 ` Christopher Larson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1432744455.404.53.camel@linuxfoundation.org \
    --to=richard.purdie@linuxfoundation.org \
    --cc=bitbake-devel@lists.openembedded.org \
    --cc=clarson@kergoth.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.