#27 Additional logging functionality

open
nobody
None
5
2012-09-14
2006-12-15
Anonymous
No

Sometimes when I log messages I need to split messages into few files in depends on its log level. This can't be done now, but I suggest add this functionality to Poco::SplitterChannel, or implement separate Poco::FilterChannel, that to be allow filter incoming messages by some parameters (log level, regexp, ...).

Also I suggest to look into log4cxx sources (http://logging.apache.org/log4cxx) to see some useful macroses (LOG4CXX_DEBUG, LOG4CXX_ERROR, ...), that allow format message with std::ostream and format it only when current logger log level allow message to be routed.


Submitted by Sergey N. Yatskevichsncc@mail.ru

Discussion

  • breeze
    breeze
    2006-12-19

    Logged In: YES
    user_id=1644940
    Originator: NO

    Macroses may looks like this:

    define LOG_TRACE(logger, message) { \

        if (logger.trace()) {\ 
        std::stringstream oss;  \ 
        oss.imbue(std::locale ("POSIX"));       \ 
        oss << message; \ 
        logger.trace(oss.str()}}
    
     
  • Logged In: NO

    I would agree that a generic Poco::Filter container might be an interesting thing to have-for various purposes and projects