Defining logstreams in a header

2014-01-13 Thread Lucas Vickers
Hi All, I'd like to avoid having to create a logstream definition in every function that needs it. Is there any way to create a logstream in the header and then attach it to a logger in the constructor? based on what I'm seeing there is not. thanks, Lucas

Re: Defining logstreams in a header

2014-01-13 Thread Rhys Ulerich
> I'd like to avoid having to create a logstream definition in every function > that needs it. > Is there any way to create a logstream in the header and then attach it to a > logger in the constructor? Could you give an example of the code that you're writing that requires repeatedly explicitly c

Re: Defining logstreams in a header

2014-01-13 Thread Lucas Vickers
Given those comments (thanks for pointing them out), I definitely will not define logstreams in my headers. The style of code that I prefer uses iostreams, so for example this type of log statement: logstream << Level::getInfo() << "Player started with SYPHON " << SYPHON << ", FBO " << FBO << ", D

Re: Defining logstreams in a header

2014-01-13 Thread Thorsten Schöning
Guten Tag Lucas Vickers, am Montag, 13. Januar 2014 um 21:26 schrieben Sie: > logstream << Level::getInfo() << "Player started with SYPHON " << > SYPHON << ", FBO " << FBO << ", DEMO " << DEMO << LOG4CXX_ENDMSG; Isn't there code missing which checks the current level, outputs your logstream etc

Re: Defining logstreams in a header

2014-01-13 Thread Rhys Ulerich
You can macro-up > logstream << Level::getInfo() << "Player started with SYPHON " << SYPHON << > ", FBO " << FBO << ", DEMO " << DEMO << LOG4CXX_ENDMSG; as LOG4CXX_INFO(logger, "Player started with SYPHON " << SYPHON << ", FBO " << FBO << ", DEMO " << DEMO); out-of-the box. In my own work,

Re: Defining logstreams in a header

2014-01-13 Thread Lucas Vickers
LOG4CXX_INFO(logger, "Player started with SYPHON " << SYPHON << ", FBO " << FBO << ", DEMO " << DEMO); This would be exactly the type of syntax that can save me from using logstreams. Didn't realize I could macro like that. thanks On Mon, Jan 13, 2014 at 4:42 PM, Rhys Ulerich wrote: > You

Re: Defining logstreams in a header

2014-01-13 Thread Thorsten Schöning
Guten Tag Lucas Vickers, am Montag, 13. Januar 2014 um 23:03 schrieben Sie: > Didn't realize I could macro like that. It's one of the documented suggested solutions: > Logging requests are made by invoking a method of a logger instance, > preferrably through the use of LOG4CXX_INFO or similar ma

Re: Defining logstreams in a header

2014-01-13 Thread Lucas Vickers
:) RTFM I guess On Mon, Jan 13, 2014 at 6:35 PM, Thorsten Schöning wrote: > Guten Tag Lucas Vickers, > am Montag, 13. Januar 2014 um 23:03 schrieben Sie: > > > Didn't realize I could macro like that. > > It's one of the documented suggested solutions: > > > Logging requests are made by invoking