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.

41 lines
787 B

  1. #include "customloglevel.h"
  2. static log4cplus::tstring const CRITICAL_STRING (LOG4CPLUS_TEXT("CRITICAL"));
  3. static log4cplus::tstring const empty_str;
  4. static
  5. tstring const &
  6. criticalToStringMethod(LogLevel ll)
  7. {
  8. if(ll == CRITICAL_LOG_LEVEL) {
  9. return CRITICAL_STRING;
  10. }
  11. else {
  12. return empty_str;
  13. }
  14. }
  15. static
  16. LogLevel
  17. criticalFromStringMethod(const tstring& s)
  18. {
  19. if(s == CRITICAL_STRING) return CRITICAL_LOG_LEVEL;
  20. return NOT_SET_LOG_LEVEL;
  21. }
  22. class CriticalLogLevelInitializer {
  23. public:
  24. CriticalLogLevelInitializer() {
  25. getLogLevelManager().pushToStringMethod(criticalToStringMethod);
  26. getLogLevelManager().pushFromStringMethod(criticalFromStringMethod);
  27. }
  28. };
  29. CriticalLogLevelInitializer criticalLogLevelInitializer_;