/home/boudevil/Projects/LOANI-0.6/LOANI-repository/ceylan/Ceylan/trunk/src/code/logs/CeylanLogHolder.h

The LogHolder object is made to be instanciated as an automatic variable in main() functions, so that it is automatically in charge of the Log system's life cycle. Besides, it allows to select the log plug to use at run-time, thanks the command-line plug options that may be passed to the executable and, therefore, to the LogHolder instance.

If this program has been called with '--HTMLPlug' as parameter in the command line, then the HTML log plug with be selected instead of the classical raw text plug ('--classicalPlug') or the console plug ('--consolePlug'), and log messages will be output accordingly. Chosing '--nullPlug' will result in no logs being output.

The classical plug is the default one.

The LogHolder instance should preferably by created outside the try/catch pair to ensure it is destroyed after all automatic variables (which must be within the try/catch pair), since their destruction might result in log messages. Thus no operation on a LogHolder instance should result in an exception, instead an emergency shutdown is triggered.

 int main( int argc, char * argv[] )
 {
   LogHolder log( argc, argv ) ;
   try 
   {
     // ensures LogHolder will be the last to be deallocated.
     ... put your program here, automatic variables included ...
   } 
   catch( etc. )
   {
	   ...
   }
 }
 
Generated on Mon Nov 29 13:38:22 2010 for Ceylan by  doxygen 1.6.3