Log.pkg 1.1 KB

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