Differences between revisions 1 and 2
Revision 1 as of 2007-08-21 21:12:19
Size: 98
Editor: gtang
Comment:
Revision 2 as of 2007-08-21 21:17:44
Size: 1035
Editor: gtang
Comment:
Deletions are marked like this. Additions are marked like this.
Line 3: Line 3:
 * ~+
+~
 * ~+EMAN2 use [http://blake.bcm.edu/eman2/doxygen_html/classEMAN_1_1Log.html Log class] to handle logging. Please refer to "[http://blake.bcm.edu/eman2/doxygen_html/log_8h-source.html log.h]".+~
 * ~+The advantage to use Log class:+~
  * It defines a generic way to do logging. The logging may go to either standard out, a file, or a pipe.
  * It may give you best performance. Log functions are defined as macros. With an option to define all macros to be void, we may make the program completely silient and remove all the IO overhead.
  * It allows different level of verbosity from 0-4, with 0 means completely silient, 4 means very verbose.
 * How to use Log:
  * in your main() file, set log level: Log::logger()->set_log_level(WARNING_LOG);
  * log message in different levels: (log functions use the same argument format like printf()).
  * To log function enter point, use ENTERFUNC; To log function exit point, use EXITFUNC.

How to use Log class in EMAN2 to print out error/warning/debugging information?

  • EMAN2 use [http://blake.bcm.edu/eman2/doxygen_html/classEMAN_1_1Log.html Log class] to handle logging. Please refer to "[http://blake.bcm.edu/eman2/doxygen_html/log_8h-source.html log.h]".

  • The advantage to use Log class:

    • It defines a generic way to do logging. The logging may go to either standard out, a file, or a pipe.
    • It may give you best performance. Log functions are defined as macros. With an option to define all macros to be void, we may make the program completely silient and remove all the IO overhead.
    • It allows different level of verbosity from 0-4, with 0 means completely silient, 4 means very verbose.
  • How to use Log:
    • in your main() file, set log level: Log::logger()->set_log_level(WARNING_LOG);

    • log message in different levels: (log functions use the same argument format like printf()).
    • To log function enter point, use ENTERFUNC; To log function exit point, use EXITFUNC.

eman2Log (last edited 2022-02-18 00:34:48 by TunayDurmaz)