[fdo-internals] Logging on exceptions

Mateusz Loskot mateusz at loskot.net
Tue Apr 24 18:44:29 EDT 2007


Hi,

While I'm testing the fdopostgis provider I use heavy logging, so in
many places my code looks as follows:

try
{
   foo()
}
catch (FdoException* e)
{
   FDOLOG_WRITE("...");

   throw FdoCommandException::Create(...);
}

Honestly, I don't like when developer's tool is very explicit and
intrusive, what makes code less readable.

I'm thinking about creating my own sub-tree of exception types in which
I could automatically log a message/state in Create() operation of an
exception.

Do you think it's a good idea that I derive my own exceptions from FDO
types and instrument it with some utilities internally?

The logging is controlled in compilation time, similarly as assertions,
so I can turn it off any time when building.

Cheers
-- 
Mateusz Loskot
http://mateusz.loskot.net


More information about the fdo-internals mailing list