Here is how I currently log any exceptions that occur in my code:
- Pass each object instance the path to a file where I want all of the logging to happen.
- Each of the objects have their own exception logging code, which is called in a finally statement.
One downside I could see to this, would be that if I had to make a change to the way that logging is done. In the case that I needed to change something with the logging, it wouldn't take place in all of the objects.
On the other hand, now it's not like every single one of my libraries depends on some error-logging library just to compile.
Am I going about this the wrong way? Is all of the error logging actually supposed to be in its own library?