ctkErrorLogLevel.h 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. /*=========================================================================
  2. Library: CTK
  3. Copyright (c) Kitware Inc.
  4. Licensed under the Apache License, Version 2.0 (the "License");
  5. you may not use this file except in compliance with the License.
  6. You may obtain a copy of the License at
  7. http://www.apache.org/licenses/LICENSE-2.0.txt
  8. Unless required by applicable law or agreed to in writing, software
  9. distributed under the License is distributed on an "AS IS" BASIS,
  10. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  11. See the License for the specific language governing permissions and
  12. limitations under the License.
  13. =========================================================================*/
  14. #ifndef CTKERRORLOGLEVEL_H
  15. #define CTKERRORLOGLEVEL_H
  16. // Qt includes
  17. #include <QObject>
  18. // CTK includes
  19. #include "ctkCoreExport.h"
  20. //------------------------------------------------------------------------------
  21. /// \ingroup Core
  22. class CTK_CORE_EXPORT ctkErrorLogLevel : public QObject
  23. {
  24. Q_OBJECT
  25. Q_FLAGS(LogLevel)
  26. public:
  27. ctkErrorLogLevel();
  28. enum LogLevel
  29. {
  30. None = 0x0,
  31. Unknown = 0x1,
  32. Status = 0x2,
  33. Trace = 0x4,
  34. Debug = 0x8,
  35. Info = 0x10,
  36. Warning = 0x20,
  37. Error = 0x40,
  38. Critical = 0x80,
  39. Fatal = 0x100
  40. };
  41. Q_DECLARE_FLAGS(LogLevels, LogLevel)
  42. QString operator ()(LogLevel logLevel);
  43. static QString logLevelAsString(ctkErrorLogLevel::LogLevel logLevel);
  44. };
  45. Q_DECLARE_OPERATORS_FOR_FLAGS(ctkErrorLogLevel::LogLevels)
  46. #endif // CTKERRORLOGLEVEL_H