CmDebug.h 901 B

1234567891011121314151617181920212223242526272829303132333435
  1. #pragma once
  2. #include "CmPrerequisitesUtil.h"
  3. #include "CmLog.h"
  4. namespace CamelotFramework
  5. {
  6. class Log;
  7. class CM_UTILITY_EXPORT Debug
  8. {
  9. public:
  10. void logDebug(const String& msg);
  11. void logInfo(const String& msg);
  12. void logWarning(const String& msg);
  13. void logError(const String& msg);
  14. void log(const String& msg, const String& channel);
  15. Log& getLog() { return mLog; }
  16. void writeAsBMP(UINT8* rawPixels, UINT32 bytesPerPixel, UINT32 width, UINT32 height, const String& filePath, bool overwrite = true) const;
  17. private:
  18. Log mLog;
  19. };
  20. CM_UTILITY_EXPORT Debug& gDebug();
  21. #define LOGDBG(x) CamelotFramework::gDebug().logDebug((x));
  22. #define LOGINFO(x) CamelotFramework::gDebug().logInfo((x));
  23. #define LOGWRN(x) CamelotFramework::gDebug().logWarning((x));
  24. #define LOGERR(x) CamelotFramework::gDebug().logError((x));
  25. #define CM_ASSERT(x) assert(x)
  26. }