Closed Bug 985612 Opened 10 years ago Closed 10 years ago

mozlog.structured.commandline.setup_logging doesn't handle ArgumentParser.parse_args return value

Categories

(Testing :: Mozbase, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED
mozilla31

People

(Reporter: ted, Assigned: ted)

Details

Attachments

(1 file)

mozlog.structured.commandline.setup_logging has an example in the docs showing that you can pass the return value of ArgumentParser.parse_args to it, but that doesn't actually work because it's not a dict it's some sort of object. There's an easy workaround, which is to pass vars(args), but that's kind of clumsy. I think we should just handle these objects since it's fairly trivial and makes the API easier to use.
This just moves the workaround into setup_logging, and adds a really simple unittest to prove that it works.
Attachment #8393714 - Flags: review?(james)
Assignee: nobody → ted
Status: NEW → ASSIGNED
Attachment #8393714 - Flags: review?(james) → review+
https://hg.mozilla.org/mozilla-central/rev/e2d226ed6926
Status: ASSIGNED → RESOLVED
Closed: 10 years ago
Flags: in-testsuite+
Resolution: --- → FIXED
Target Milestone: --- → mozilla31
You need to log in before you can comment on or make changes to this bug.