Closed Bug 675376 Opened 14 years ago Closed 14 years ago

Add better support for logging in test support

Categories

(Cloud Services :: Server: Core, defect)

x86
macOS
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: telliott, Assigned: tarek)

References

Details

(Whiteboard: [qa-])

Attachments

(1 file)

It would be nice to have a way to easily make logging seamless in tests, particularly those that use WebTest (so are talking to an "independent" server. Right now, they aren't in the app config (and tarek is correct that it's not really an app function). Even something as simple as initlog(product, file) at the start of the tests might be sufficient, though there's a lot we could do past that.
Assignee: nobody → tarek
Blocks: 676423
Here's the log catcher the usage is very simple: with catch_logs() as logs: ..your test.. logs = logs.read() by default it catches the syncserver logger at the error level, but you can catch any level, and any logger -- see the tests This supersede the need to set up the logger via a config file or programmatically
Attachment #550992 - Flags: review?(telliott)
Attachment #550992 - Flags: review?(rmiller)
Comment on attachment 550992 [details] [diff] [review] context manager to catch logs Looks good to me, though I'll defer to rmiller as to how it fits into the stuff he's working on.
Attachment #550992 - Flags: review?(telliott) → review+
Attachment #550992 - Flags: review?(rmiller) → review+
Status: NEW → RESOLVED
Closed: 14 years ago
Resolution: --- → FIXED
Whiteboard: [qa-]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: