You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

35 lines
1.2 KiB

  1. #include <iostream>
  2. #include "gtest/gtest.h"
  3. #include "log4cplus/logger.h"
  4. #include "log4cplus/loggingmacros.h"
  5. #include "log4cplus/consoleappender.h"
  6. #include "log4cplus/fileappender.h"
  7. log4cplus::Logger logger;
  8. /*!
  9. * Initializes the logging framework.
  10. */
  11. void setUpLogging() {
  12. log4cplus::SharedAppenderPtr fileLogAppender(new log4cplus::FileAppender("storm-tests.log"));
  13. fileLogAppender->setName("mainFileAppender");
  14. fileLogAppender->setLayout(std::auto_ptr<log4cplus::Layout>(new log4cplus::PatternLayout("%-5p - %D{%H:%M} (%r ms) - %F:%L : %m%n")));
  15. logger = log4cplus::Logger::getInstance("mainLogger");
  16. logger.addAppender(fileLogAppender);
  17. // Uncomment these lines to enable console logging output
  18. // log4cplus::SharedAppenderPtr consoleLogAppender(new log4cplus::ConsoleAppender());
  19. // consoleLogAppender->setName("mainConsoleAppender");
  20. // consoleLogAppender->setLayout(std::auto_ptr<log4cplus::Layout>(new log4cplus::PatternLayout("%-5p - %D{%H:%M:%s} (%r ms) - %F:%L : %m%n")));
  21. // logger.addAppender(consoleLogAppender);
  22. }
  23. int main(int argc, char** argv) {
  24. setUpLogging();
  25. std::cout << "STORM Testing Suite" << std::endl;
  26. testing::InitGoogleTest(&argc, argv);
  27. return RUN_ALL_TESTS();
  28. }