MongoLog.php 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148
  1. <?php
  2. /*
  3. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  4. * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  5. * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  6. * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
  7. * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  8. * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  9. * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  10. * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  11. * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  12. * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  13. * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  14. */
  15. class MongoLog {
  16. /**
  17. * @link http://php.net/manual/en/class.mongolog.php#mongolog.constants.none
  18. */
  19. const NONE = 0;
  20. /**
  21. * @link http://php.net/manual/en/class.mongolog.php#mongolog.constants.all
  22. */
  23. const ALL = 0;
  24. /**
  25. * @link http://php.net/manual/en/class.mongolog.php#mongolog.constants.warning
  26. */
  27. const WARNING = 0;
  28. /**
  29. * @link http://php.net/manual/en/class.mongolog.php#mongolog.constants.info
  30. */
  31. const INFO = 0;
  32. /**
  33. * @link http://php.net/manual/en/class.mongolog.php#mongolog.constants.fine
  34. */
  35. const FINE = 0;
  36. /**
  37. * @link http://php.net/manual/en/class.mongolog.php#mongolog.constants.rs
  38. */
  39. const RS = 0;
  40. /**
  41. * @link http://php.net/manual/en/class.mongolog.php#mongolog.constants.pool
  42. */
  43. const POOL = 0;
  44. /**
  45. * @link http://php.net/manual/en/class.mongolog.php#mongolog.constants.io
  46. */
  47. const IO = 0;
  48. /**
  49. * @link http://php.net/manual/en/class.mongolog.php#mongolog.constants.server
  50. */
  51. const SERVER = 0;
  52. /**
  53. * @link http://php.net/manual/en/class.mongolog.php#mongolog.constants.parse
  54. */
  55. const PARSE = 0;
  56. const CON = 2;
  57. /**
  58. * (PECL mongo &gt;= 1.3.0)<br/>
  59. * <p>
  60. * This function will set a callback function to be called for {@link http://www.php.net/manual/en/class.mongolog.php MongoLog} events
  61. * instead of triggering warnings.
  62. * </p>
  63. * @link http://www.php.net/manual/en/mongolog.setcallback.php
  64. * @param callable $log_function <p>
  65. * The function to be called on events.
  66. * </p>
  67. * <p>
  68. * The function should have the following prototype
  69. * </p>
  70. *
  71. * <em>log_function</em> ( <em>int</em> <em>$module</em> , <em>int</em> <em>$level</em>, <em>string</em> <em>$message</em>)
  72. * <ul>
  73. * <li>
  74. * <b><i>module</i></b>
  75. *
  76. * <p>One of the {@link http://www.php.net/manual/en/class.mongolog.php#mongolog.constants.module MongoLog module constants}.</p>
  77. * </li>
  78. * <li>
  79. * <b><i>level</i></b>
  80. *
  81. * <p>One of the {@link http://www.php.net/manual/en/class.mongolog.php#mongolog.constants.level MongoLog level constants}.</p>
  82. * </li
  83. * <li>
  84. * <b><i>message</i></b>
  85. *
  86. * <p>The log message itself.</p></li>
  87. * <ul>
  88. * @return boolean Returns <b>TRUE</b> on success or <b>FALSE</b> on failure.
  89. */
  90. public static function setCallback ( callable $log_function ) {}
  91. /**
  92. * This function can be used to set how verbose logging should be and the types of
  93. * activities that should be logged. Use the constants described in the MongoLog
  94. * section with bitwise operators to specify levels.
  95. *
  96. * @link http://php.net/manual/en/mongolog.setlevel.php
  97. * @static
  98. * @param int $level The levels you would like to log
  99. * @return void
  100. */
  101. public static function setLevel($level) {}
  102. /**
  103. * This can be used to see the log level. Use the constants described in the
  104. * MongoLog section with bitwise operators to check the level.
  105. *
  106. * @link http://php.net/manual/en/mongolog.getlevel.php
  107. * @static
  108. * @return int Returns the current level
  109. */
  110. public static function getLevel() {}
  111. /**
  112. * This function can be used to set which parts of the driver's functionality
  113. * should be logged. Use the constants described in the MongoLog section with
  114. * bitwise operators to specify modules.
  115. *
  116. * @link http://php.net/manual/en/mongolog.setmodule.php
  117. * @static
  118. * @param int $module The module(s) you would like to log
  119. * @return void
  120. */
  121. public static function setModule($module) {}
  122. /**
  123. * This function can be used to see which parts of the driver's functionality are
  124. * being logged. Use the constants described in the MongoLog section with bitwise
  125. * operators to check if specific modules are being logged.
  126. *
  127. * @link http://php.net/manual/en/mongolog.getmodule.php
  128. * @static
  129. * @return int Returns the modules currently being logged
  130. */
  131. public static function getModule() {}
  132. }