BIND 10 #755: Python logging - produce dictionary from message file
BIND 10 Development
do-not-reply at isc.org
Fri Jun 3 08:56:22 UTC 2011
#755: Python logging - produce dictionary from message file
-------------------------------------+-------------------------------------
Reporter: | Owner: vorner
stephen | Status: reviewing
Type: | Milestone:
enhancement | Sprint-20110614
Priority: minor | Resolution:
Component: | Sensitive: 0
logging | Sub-Project: DNS
Keywords: | Estimated Difficulty: 0.0
Defect Severity: N/A | Total Hours: 0
Feature Depending on Ticket: |
Add Hours to Ticket: 0 |
Internal?: 0 |
-------------------------------------+-------------------------------------
Changes (by stephen):
* owner: stephen => vorner
Comment:
> I implemented it. There were no tests for the message compiler and I
followed the tradition, mostly because we don't really ship this code, we
use it as our compilation tool.
True, although this is perhaps something we could think of adding.
> The idea is that there'll be a isc.log.message.Message class (it's not
written yet, not part of this ticket, but for this reason, the generated
file won't compile yet). It'll hold the message and register itself
somewhere at creation time (preferably as some kind of weak reference, in
case we allow unloading modules in future), so the message can be replaced
by some dictionary.
The implementation of Python logging is part of #756. I had been thinking
that we would put a Python wrapper around the C++ logging library and use
the code there. In that way, the logging capability and configuration are
consistent across all modules in BIND 10.
The only part of this I had been unsure about was how to register the
default messages in the main dictionary. One option would have been to
produce the .cc/.c file and include them along with the logging library.
The alternative you have implemented - define the message ID and the
default text in the Python module - will work better. Presumably the
return value from isc.log.message.Message is the message ID?
Please merge.
--
Ticket URL: <http://bind10.isc.org/ticket/755#comment:5>
BIND 10 Development <http://bind10.isc.org>
BIND 10 Development
More information about the bind10-tickets
mailing list