Log.pkg 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. $#include "IO/Log.h"
  2. static const int LOG_TRACE;
  3. static const int LOG_DEBUG;
  4. static const int LOG_INFO;
  5. static const int LOG_WARNING;
  6. static const int LOG_ERROR;
  7. static const int LOG_NONE;
  8. class Log : public Object
  9. {
  10. void Open(const String fileName);
  11. void Close();
  12. void SetLevel(int level);
  13. void SetTimeStamp(bool enable);
  14. void SetQuiet(bool quiet);
  15. int GetLevel() const;
  16. bool GetTimeStamp() const;
  17. String GetLastMessage() const;
  18. bool IsQuiet() const;
  19. static void Write(int level, const String message);
  20. static void WriteRaw(const String message, bool error = false);
  21. tolua_property__get_set int level;
  22. tolua_property__get_set bool timeStamp;
  23. tolua_property__is_set bool quiet;
  24. };
  25. Log* GetLog();
  26. tolua_readonly tolua_property__get_set Log* log;
  27. ${
  28. #define TOLUA_DISABLE_tolua_IOLuaAPI_GetLog00
  29. static int tolua_IOLuaAPI_GetLog00(lua_State* tolua_S)
  30. {
  31. return ToluaGetSubsystem<Log>(tolua_S);
  32. }
  33. #define TOLUA_DISABLE_tolua_get_log_ptr
  34. #define tolua_get_log_ptr tolua_IOLuaAPI_GetLog00
  35. $}