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.

32 lines
766 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. log4cplus::initialize ();
  15. printMsgs();
  16. cout << "Turning on debug..." << endl;
  17. LogLog::getLogLog()->setInternalDebugging(true);
  18. printMsgs();
  19. cout << "Turning on quiet mode..." << endl;
  20. LogLog::getLogLog()->setQuietMode(true);
  21. printMsgs();
  22. return 0;
  23. }