Click to See Complete Forum and Search --> : error messages


yagelm
November 3rd, 2005, 12:59 AM
Hi,

I'm working on a big project that encapsulates a lot of classes.
I need to be able to send error messages from any place in the code.
All the messages need to be sent into a file.
What is the best way to accomplish that ?
Should i use global variable similar to 'cout' ?
I am using object oriented programming with c++ .

thanks in advance

RoboTact
November 3rd, 2005, 02:49 PM
Hi,

I'm working on a big project that encapsulates a lot of classes.
I need to be able to send error messages from any place in the code.
All the messages need to be sent into a file.
What is the best way to accomplish that ?
Should i use global variable similar to 'cout' ?
I am using object oriented programming with c++ .

thanks in advance
This question should go to C++ forum then.

It depends on what you want to accompish. Basically you throw exception. Also you can use logger to store kind of running history to track that error cause. In some cases it's better to provide recovery code to run on in release version of programm (but save a way to report in debug version and if there would even potentially be a way to send report from release version).
Anyway, if there any concept to ask about it? You either make it up, or study thoroughly, which isn't the case of asking on forum.