Opened 15 years ago

Closed 12 years ago

#2629 enhancement closed wontfix (wontfix)

passing the "why" argument to log.err is hard and crappy

Reported by: radix Owned by:
Priority: normal Milestone:
Component: core Keywords:
Cc: Branch:


    log.err(None, "foo")

or log.err(_why="foo")

trying to pass why= directly causes the following error:

    msg(failure=_stuff, why=_why, isError=1, **kw)
TypeError: msg() got multiple values for keyword argument 'why'

Which is dumb. Either _why= should be renamed to why= or the special passing of why=_why should only happen if _why is not None.

Fixing this ticket should also entail fixing #2567

Change History (4)

comment:1 Changed 15 years ago by radix

Owner: changed from Glyph to radix
Status: newassigned

comment:2 Changed 12 years ago by Jean-Paul Calderone

I like log.err(None, "foo") a lot, and I think that was the intended use when the feature was introduced. The parameter isn't named why because log.err accepts **kw and passes them on to log.msg. The leading underscore is an attempt to avoid collisions (perhaps a poor one, but there you go).

I think this should be closed as wontfix or turned into a documentation ticket for explaining this feature of log.err better in the logging howto.

What do you think, radix?

comment:3 Changed 12 years ago by Jean-Paul Calderone

Resolution: wontfix
Status: assignedclosed

< radix> ok

comment:4 Changed 11 years ago by <automation>

Owner: radix deleted
Note: See TracTickets for help on using tickets.