Merge lp://qastaging/~gz/bzr/2.4_robust_logging_714449 into lp://qastaging/bzr/2.4
| Status: | Merged |
|---|---|
| Approved by: | Vincent Ladeuil on 2011-12-02 |
| Approved revision: | no longer in the source branch. |
| Merged at revision: | 6063 |
| Proposed branch: | lp://qastaging/~gz/bzr/2.4_robust_logging_714449 |
| Merge into: | lp://qastaging/bzr/2.4 |
| Diff against target: |
201 lines (+115/-13) 3 files modified
bzrlib/tests/__init__.py (+2/-2) bzrlib/tests/test_trace.py (+67/-0) bzrlib/trace.py (+46/-11) |
| To merge this branch: | bzr merge lp://qastaging/~gz/bzr/2.4_robust_logging_714449 |
| Related bugs: |
| Reviewer | Review Type | Date Requested | Status |
|---|---|---|---|
| Jelmer Vernooij (community) | 2011-11-30 | Approve on 2011-12-01 | |
|
Review via email:
|
|||
Commit Message
Making logging non-ascii strings more robust with new EncodedStreamHa
Description of the Change
The logging module's handler classes have lots of code for dealing with broken records, but tend to print useless tracebacks to stderr in rather common cases. This branch implements an alternative handler class, which transcodes utf-8 byte strings rather giving a traceback, and records errors via .bzr.log rather than stderr.
This only affects code paths going through the logging module. Notably, trace.mutter has its own, slightly different, heuristics still. Also the long standing problem of `bzr: ERROR: ...` not being correctly encoded is also left for a future branch as are other places that write directly to stderr.
I wanted to add a blackbox test here as well, but the one from the bug report has now changed by chance, and ideally more code would move off trace.note to ui.ui_factory.note or other neater interfaces.
| Martin Packman (gz) wrote : | # |
sent to pqm by email

This seems like a reasonable thing to do, though it's kind of disappointing we have to. Having these errors logged to .bzr.log should be fine though, and means less noise for our users.