[bind10-dev] Questions on the Logging API
Likun Zhang
zlkzhy at gmail.com
Mon Dec 20 03:39:13 UTC 2010
Hi stephen,
Some feedback for reference.
> 1. In C++, should the symbols be "const char*" or should they be numbers?
I would like 'const char*' with some meaningful names, so that when reading
the code, we don't have to go back to message definition file to check what
it means.
>
> 2. Should we use this scheme for C++ exception messages?
>
> If so, we would need to change the way exceptions are thrown. At present
we
> have:
>
> isc_throw(exception_class, stream)
>
> . where "stream" can be output with a construct of the form "oss <<
steam".
> This has allowed us to write things like:
>
> isc_throw(InvalidTime, "Invalid " << valname << "value: " << value);
>
> With an external message file we would need to move away from the stream
> format (as it allows the splitting a the text of a message into multiple
fragments,
> e.g. "Invalid" and "value: " in the example above) and instead write
something
> like:
>
> isc_throw(InvalidTime, INVALTIME, valname, value)
>
> Is this a change we want to make?
Maybe it depends,
Depends on whether the message is useful to the users. If an exception is
thrown and caught properly, it should be treated as some error message.
If bind10 refuses to work because the exception, the user should report the
bug to bind10-dev list, I don't think the user really want to know what the
message really mean. Like my windows os, it's chinese version, but I never
get an chinese error message when blue screen occurs to me, I just restart
my computer.
>
> 3. Is there a need for C++ and Python to communicate information about
> message codes (e.g. Python module passes a code to C++ that the latter
> interprets and outputs)?
Don't think so, where c++ and python need to communicate message
information?
More information about the bind10-dev
mailing list