Am 14.06.2013 17:34, schrieb Alan Miller:

Can someone summarize how to setup logging from multiple pages/modules?

I got the example main.cpp to work, e.g.:

  /* this is main.cpp */

  #include <cxxtools/log.h>

  log_define("myapp");

  int main(int argc, char* argv[]) {

  log_init("myapp.properties");

 ....

  log_info("starting myapp");

}

But I have several modules (page1.ecpp, page2,ecpp,...) where I want to

log something but write to the same log file (defined in myapp.properties).

In page{1,2,...}.ecpp where do I need to call log_define() and log_init().

Obviously, when different pages are requested I don't want to truncate

or reinitiate the file every time.

Alan

Hi,

ecppc already generates a log_define for you. You just have to do log_info (or log_warn or log_error or log_debug). The logging category for the component is "component./componentname/".

So if you have a page "page1.ecpp" and have a log_info statement there, it should be visible already in your log file since info is normally enabled. You can also define a own logging level by putting a line:

    logger.component.page1=DEBUG

into your myapp.properties.

The log_init must be called only once in your application.

Tommi
------------------------------------------------------------------------------
This SF.net email is sponsored by Windows:

Build for Windows Store.

http://p.sf.net/sfu/windows-dev2dev
_______________________________________________
Tntnet-general mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/tntnet-general

Reply via email to