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.

31 lines
736 B

  1. #include <iostream>
  2. #include <log4cplus/helpers/loglog.h>
  3. using namespace std;
  4. using namespace log4cplus::helpers;
  5. void printMsgs() {
  6. cout << "Entering printMsgs()..." << endl;
  7. LogLog::getLogLog()->debug(LOG4CPLUS_TEXT("This is a Debug statement..."));
  8. LogLog::getLogLog()->warn(LOG4CPLUS_TEXT("This is a Warning..."));
  9. LogLog::getLogLog()->error(LOG4CPLUS_TEXT("This is a Error..."));
  10. cout << "Exiting printMsgs()..." << endl << endl;
  11. }
  12. int
  13. main() {
  14. printMsgs();
  15. cout << "Turning on debug..." << endl;
  16. LogLog::getLogLog()->setInternalDebugging(true);
  17. printMsgs();
  18. cout << "Turning on quiet mode..." << endl;
  19. LogLog::getLogLog()->setQuietMode(true);
  20. printMsgs();
  21. return 0;
  22. }