Hello, > Well, it's less readable, as I said in parentheses. It would work, of course. > And the special wrappers needn't be too intrusive: > > __ = BraceMessage > > logger.debug(__("Message with {0} {1}", 1, "argument")) Ah, I hadn't thought about that. It looks a bit less awful indeed. I'm of the opinion, however, that %-formatting should remain the default and shouldn't need a wrapper. There's another possibility, which is to build the wrapping directly around the logger. That is, if I want a %-style logger, I do: logger = logging.getLogger("smtp") logger.debug("incoming email from %s", sender_address) and I want a {}-style logger, I do: logger = logging.getLogger("smtp", style="{}") logger.debug("incoming email from {addr}", addr=sender_address) (of course, different users of the "smtp" logger can request different formatting styles when calling getLogger().) We could combine the various proposals to give users flexible APIs. Of course, it generally smells of "there's more than one way to do it". > It's the Rumsfeldian "We don't know what we don't know" Is this guy in the Python community? :-) > I'm just trying to think ahead, and can't claim to have got a definitive answer > up my sleeve. Sure, we have some time until 2.7/3.2 anyway. Regards Antoine.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4