[ros-users] rosconsole ROS_DEBUG_NAMED

Josh Faust jfaust at willowgarage.com
Fri Oct 22 20:59:33 UTC 2010


You can register your own appender through log4cxx.  For example (cribbed
from roscpp/src/libros/file_log.cpp:

    const log4cxx::LoggerPtr& logger =
log4cxx::Logger::getLogger(ROSCONSOLE_DEFAULT_NAME ".<your_name>");
    log4cxx::LayoutPtr layout = new log4cxx::PatternLayout("[%c] [%d]
[thread %t]: [%p] %m\n");
    log4cxx::RollingFileAppenderPtr appender = new
log4cxx::RollingFileAppender(layout, <your logfile name>, false);
    appender->setMaximumFileSize(100*1024*1024);
    appender->setMaxBackupIndex(10);
    log4cxx::helpers::Pool pool;
    appender->activateOptions(pool);
    logger->addAppender(appender);

Josh

On Fri, Oct 22, 2010 at 1:48 PM, Mike Phillips <miph at seas.upenn.edu> wrote:

> Hi,
> When I use a named ros print I see that it gets its own logger level
> but the output still gets dumped into the same log file as every other
> print from that node.  Is there a way to have named prints go to their
> own log files?
>
> -Mike-
> _______________________________________________
> ros-users mailing list
> ros-users at code.ros.org
> https://code.ros.org/mailman/listinfo/ros-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ros.org/pipermail/ros-users/attachments/20101022/4e98665f/attachment-0003.html>


More information about the ros-users mailing list