Merge lp:~adeuring/lazr.jobrunner/use_job_repr_in_logging into lp:lazr.jobrunner
| Status: | Merged |
|---|---|
| Approved by: | Aaron Bentley on 2012-03-22 |
| Approved revision: | 18 |
| Merged at revision: | 22 |
| Proposed branch: | lp:~adeuring/lazr.jobrunner/use_job_repr_in_logging |
| Merge into: | lp:lazr.jobrunner |
| Diff against target: |
26 lines (+4/-3) 1 file modified
src/lazr/jobrunner/jobrunner.py (+4/-3) |
| To merge this branch: | bzr merge lp:~adeuring/lazr.jobrunner/use_job_repr_in_logging |
| Related bugs: |
| Reviewer | Review Type | Date Requested | Status |
|---|---|---|---|
| Aaron Bentley (community) | Approve on 2012-03-22 | ||
| j.c.sackett (community) | 2012-03-22 | Approve on 2012-03-22 | |
| Richard Harding (community) | code* | 2012-03-22 | Approve on 2012-03-22 |
|
Review via email:
|
|||
Description of the Change
Some classes that are dervied from BaseRunnableJob in the Launchpad source code define __repr__(), and repr(job) was used by the old job implementation in log messages.
This change fixes failures in these Launchpad tests:
lp.registry.
lp.registry.
lp.registry.
(the first two tests need also an s/DEBUG/INFO / in an assertWhatever() call, but i think it is reasonable to change the log level from DEBUG to INFO.)
| Abel Deuring (adeuring) wrote : | # |
| Aaron Bentley (abentley) wrote : | # |
Please use a more standard __repr__ such as "<Job>" or "Job(id=5)". Other than that, this is fine.
| Abel Deuring (adeuring) wrote : | # |
On 22.03.2012 16:29, Aaron Bentley wrote:
> Review: Approve
>
> Please use a more standard __repr__ such as "<Job>" or "Job(id=5)". Other than that, this is fine.
I used '<%s>' % self.__
<%s(%s)> % (self._
would let the job ID disappear from log messages when a derived class
has its own __repr__() method.

see also https:/ /code.launchpad .net/~adeuring/ launchpad/ lp-lazr. jobrunner/ +merge/ 97458 for related changes in the main LP code.