debug.m 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. /*---------------------------------------------------
  2. -----------------------------------------------------
  3. Filename: debug.m
  4. Version: 1.2
  5. Type: maki/attrib loader
  6. Date: 29. Aug. 2006 - 23:43
  7. Author: Martin Poehlmann aka Deimos
  8. E-Mail: [email protected]
  9. Internet: www.skinconsortium.com
  10. www.martin.deimos.de.vu
  11. -----------------------------------------------------
  12. ---------------------------------------------------*/
  13. #ifndef included
  14. #error This script can only be compiled as a #include
  15. #endif
  16. #ifndef DEBUG
  17. #define debugString //
  18. #endif
  19. #ifdef DEBUG
  20. #define DEBUG_PREFIX "["+ FILE_NAME +": " + getTimeStamp() + "] " +
  21. Function String getTimeStamp();
  22. String getTimeStamp()
  23. {
  24. int msc = getTimeOfDay();
  25. int h = msc / 1000 / 3600;
  26. msc -= h * 1000 * 3600;
  27. int m = msc / 1000 / 60;
  28. msc -= m * 1000 * 60;
  29. int s = msc / 1000;
  30. msc -= s * 1000;
  31. string zeros = "";
  32. if (msc < 100)
  33. {
  34. zeros += "0";
  35. }
  36. if (msc < 10)
  37. {
  38. zeros += "0";
  39. }
  40. return integerToString(h)+":"+integerToString(m)+":"+integerToString(s)+"."+zeros+integerToString(msc);
  41. }
  42. #define D_WTF 9
  43. #define D_NWTF 9
  44. #endif