y_debug.inc 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145
  1. /**
  2. * <library name="y_debug">
  3. * <section>
  4. * Description
  5. * </section>
  6. * <p>Ensures debug levels are set and defines debug functions.</p>
  7. *
  8. * <p>General debug levels:</p>
  9. *
  10. * <ul>
  11. * <li>-1 - Run-time selected debug level.</li>
  12. * <li>0 - No debug information.</li>
  13. * <li>1 - Callbacks and timers.</li>
  14. * <li>2 - Remote functions.</li>
  15. * <li>3 - Stock functions.</li>
  16. * <li>4 - Static functions.</li>
  17. * <li>5 - Code.</li>
  18. * <li>6 - Loops.</li>
  19. * <li>7 - Extra loop code.</li>
  20. * </ul>
  21. *
  22. * <p>If you use <c>P:0</c> you get an optional debug print controlled by the
  23. * global state <c>ysi_debug</c> - which is either on or off.</p>
  24. * <section>
  25. * Version
  26. * </section>
  27. * 1.0
  28. * <section>
  29. * Functions
  30. * </section>
  31. * <subsection>
  32. * Inline
  33. * </subsection><ul>
  34. * <symbol name="Debug_Code">Runs defined code if a certain level is active.</symbol>
  35. * <symbol name="Debug_Print">Prints the formatted string provided at the given level.</symbol>
  36. * </ul><subsection>
  37. * Stock
  38. * </subsection><ul>
  39. * <symbol name="Debug_PrintArray">Print several items from an array for debugging purposes.</symbol>
  40. * <symbol name="Debug_Enable">Turn on level 0 prints.</symbol>
  41. * <symbol name="Debug_Disable">Turn off level 0 prints.</symbol>
  42. * <symbol name="Debug_Level">Set the debug level when the code is compiled with
  43. * <c>_DEBUG=-1</c>, which means full run-time selection.</symbol>
  44. * </ul><section>
  45. * Definitions
  46. * </section><ul>
  47. * <symbol name="P:&lt;0-6&gt;">Print a message.</symbol>
  48. * <symbol name="P:C">Run debug code.</symbol>
  49. * <symbol name="P:E">Print an error message.</symbol>
  50. * <symbol name="P:W">Print a warning message.</symbol>
  51. * </ul><section>Compile options</section><ul>
  52. * <symbol name="_DEBUG">Debugging level to use.</symbol>
  53. * </ul>
  54. * </library>
  55. *//** *//*
  56. Legal:
  57. Version: MPL 1.1
  58. The contents of this file are subject to the Mozilla Public License Version
  59. 1.1 the "License"; you may not use this file except in compliance with
  60. the License. You may obtain a copy of the License at
  61. http://www.mozilla.org/MPL/
  62. Software distributed under the License is distributed on an "AS IS" basis,
  63. WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
  64. for the specific language governing rights and limitations under the
  65. License.
  66. The Original Code is the YSI framework.
  67. The Initial Developer of the Original Code is Alex "Y_Less" Cole.
  68. Portions created by the Initial Developer are Copyright C 2011
  69. the Initial Developer. All Rights Reserved.
  70. Contributors:
  71. Y_Less
  72. koolk
  73. JoeBullet/Google63
  74. g_aSlice/Slice
  75. Misiur
  76. samphunter
  77. tianmeta
  78. maddinat0r
  79. spacemud
  80. Crayder
  81. Dayvison
  82. Ahmad45123
  83. Zeex
  84. irinel1996
  85. Yiin-
  86. Chaprnks
  87. Konstantinos
  88. Masterchen09
  89. Southclaws
  90. PatchwerkQWER
  91. m0k1
  92. paulommu
  93. udan111
  94. Thanks:
  95. JoeBullet/Google63 - Handy arbitrary ASM jump code using SCTRL.
  96. ZeeX - Very productive conversations.
  97. koolk - IsPlayerinAreaEx code.
  98. TheAlpha - Danish translation.
  99. breadfish - German translation.
  100. Fireburn - Dutch translation.
  101. yom - French translation.
  102. 50p - Polish translation.
  103. Zamaroht - Spanish translation.
  104. Los - Portuguese translation.
  105. Dracoblue, sintax, mabako, Xtreme, other coders - Producing other modes for
  106. me to strive to better.
  107. Pixels^ - Running XScripters where the idea was born.
  108. Matite - Pestering me to release it and using it.
  109. Very special thanks to:
  110. Thiadmer - PAWN, whose limits continue to amaze me!
  111. Kye/Kalcor - SA:MP.
  112. SA:MP Team past, present and future - SA:MP.
  113. Optional plugins:
  114. Gamer_Z - GPS.
  115. Incognito - Streamer.
  116. Me - sscanf2, fixes2, Whirlpool.
  117. */
  118. #if !defined _INC_y_utils
  119. #tryinclude "y_core\y_core_entry"
  120. #endif
  121. #if !defined _INC_y_core
  122. #tryinclude "YSI_Core\y_core\y_core_entry"
  123. #endif
  124. #if !defined _INC_y_core
  125. #tryinclude "YSI\YSI_Core\y_core\y_core_entry"
  126. #endif
  127. #if !defined _INC_y_core
  128. #tryinclude <YSI_Core\y_core\y_core_entry>
  129. #endif
  130. #if !defined _INC_y_core
  131. #tryinclude <YSI\YSI_Core\y_core\y_core_entry>
  132. #endif
  133. #if !defined _INC_y_core
  134. #error Could not find y_debug
  135. #endif