This sample program can be compiled with 0.11.0 but not 0.12.0. The error
is "Cannot convert ‘ROSConsoleStdioAppender*’ to ‘log4cxx::App
enderPtr’ {aka ‘std::shared_ptr<log4cxx::Appender>’}". What change do I
need to make it works with 0,12.0? Thank you.

#include <log4cxx/log4cxx.h>
#include <log4cxx/basicconfigurator.h>
#include <log4cxx/helpers/exception.h>
#include <log4cxx/logger.h>
#include <log4cxx/level.h>
#include <log4cxx/appenderskeleton.h>

using namespace log4cxx;
using namespace log4cxx::helpers;

class ROSConsoleStdioAppender : public log4cxx::AppenderSkeleton
{
public:
  ~ROSConsoleStdioAppender()
  {
  }

protected:
  virtual void append(const log4cxx::spi::LoggingEventPtr& event,
                      log4cxx::helpers::Pool&)
  {
  }

  virtual void close()
  {
  }

  virtual bool requiresLayout() const
  {
    return false;
  }
};

int main(){
    LoggerPtr logger(Logger::getLogger("main"));
    logger->addAppender(new ROSConsoleStdioAppender);
    return 0;
}

Reply via email to