ILogger.php 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188
  1. <?php
  2. declare(strict_types=1);
  3. /**
  4. * @copyright Copyright (c) 2016, ownCloud, Inc.
  5. *
  6. * @author Arthur Schiwon <blizzz@arthur-schiwon.de>
  7. * @author Bernhard Posselt <dev@bernhard-posselt.com>
  8. * @author Christoph Wurst <christoph@winzerhof-wurst.at>
  9. * @author Jan-Christoph Borchardt <hey@jancborchardt.net>
  10. * @author Lukas Reschke <lukas@statuscode.ch>
  11. * @author Morris Jobke <hey@morrisjobke.de>
  12. * @author Roeland Jago Douma <roeland@famdouma.nl>
  13. * @author Thomas Müller <thomas.mueller@tmit.eu>
  14. *
  15. * @license AGPL-3.0
  16. *
  17. * This code is free software: you can redistribute it and/or modify
  18. * it under the terms of the GNU Affero General Public License, version 3,
  19. * as published by the Free Software Foundation.
  20. *
  21. * This program is distributed in the hope that it will be useful,
  22. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  23. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  24. * GNU Affero General Public License for more details.
  25. *
  26. * You should have received a copy of the GNU Affero General Public License, version 3,
  27. * along with this program. If not, see <http://www.gnu.org/licenses/>
  28. *
  29. */
  30. namespace OCP;
  31. /**
  32. * Interface ILogger
  33. * @since 7.0.0
  34. *
  35. * This logger interface follows the design guidelines of PSR-3
  36. * https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-3-logger-interface.md#3-psrlogloggerinterface
  37. * @deprecated 20.0.0 use the PSR-3 logger \Psr\Log\LoggerInterface
  38. */
  39. interface ILogger {
  40. /**
  41. * @since 14.0.0
  42. * @deprecated 20.0.0
  43. */
  44. public const DEBUG = 0;
  45. /**
  46. * @since 14.0.0
  47. * @deprecated 20.0.0
  48. */
  49. public const INFO = 1;
  50. /**
  51. * @since 14.0.0
  52. * @deprecated 20.0.0
  53. */
  54. public const WARN = 2;
  55. /**
  56. * @since 14.0.0
  57. * @deprecated 20.0.0
  58. */
  59. public const ERROR = 3;
  60. /**
  61. * @since 14.0.0
  62. * @deprecated 20.0.0
  63. */
  64. public const FATAL = 4;
  65. /**
  66. * System is unusable.
  67. *
  68. * @param string $message
  69. * @param array $context
  70. * @return null
  71. * @since 7.0.0
  72. * @deprecated 20.0.0 use \Psr\Log\LoggerInterface::emergency
  73. */
  74. public function emergency(string $message, array $context = []);
  75. /**
  76. * Action must be taken immediately.
  77. *
  78. * @param string $message
  79. * @param array $context
  80. * @return null
  81. * @since 7.0.0
  82. * @deprecated 20.0.0 use \Psr\Log\LoggerInterface::alert
  83. */
  84. public function alert(string $message, array $context = []);
  85. /**
  86. * Critical conditions.
  87. *
  88. * @param string $message
  89. * @param array $context
  90. * @return null
  91. * @since 7.0.0
  92. * @deprecated 20.0.0 use \Psr\Log\LoggerInterface::critical
  93. */
  94. public function critical(string $message, array $context = []);
  95. /**
  96. * Runtime errors that do not require immediate action but should typically
  97. * be logged and monitored.
  98. *
  99. * @param string $message
  100. * @param array $context
  101. * @return null
  102. * @since 7.0.0
  103. * @deprecated 20.0.0 use \Psr\Log\LoggerInterface::error
  104. */
  105. public function error(string $message, array $context = []);
  106. /**
  107. * Exceptional occurrences that are not errors.
  108. *
  109. * @param string $message
  110. * @param array $context
  111. * @return null
  112. * @since 7.0.0
  113. * @deprecated 20.0.0 use \Psr\Log\LoggerInterface::warning
  114. */
  115. public function warning(string $message, array $context = []);
  116. /**
  117. * Normal but significant events.
  118. *
  119. * @param string $message
  120. * @param array $context
  121. * @return null
  122. * @since 7.0.0
  123. * @deprecated 20.0.0 use \Psr\Log\LoggerInterface::notice
  124. */
  125. public function notice(string $message, array $context = []);
  126. /**
  127. * Interesting events.
  128. *
  129. * @param string $message
  130. * @param array $context
  131. * @return null
  132. * @since 7.0.0
  133. * @deprecated 20.0.0 use \Psr\Log\LoggerInterface::info
  134. */
  135. public function info(string $message, array $context = []);
  136. /**
  137. * Detailed debug information.
  138. *
  139. * @param string $message
  140. * @param array $context
  141. * @return null
  142. * @since 7.0.0
  143. * @deprecated 20.0.0 use \Psr\Log\LoggerInterface::debug
  144. */
  145. public function debug(string $message, array $context = []);
  146. /**
  147. * Logs with an arbitrary level.
  148. *
  149. * @param int $level
  150. * @param string $message
  151. * @param array $context
  152. * @return mixed
  153. * @since 7.0.0
  154. * @deprecated 20.0.0 use \Psr\Log\LoggerInterface::log
  155. */
  156. public function log(int $level, string $message, array $context = []);
  157. /**
  158. * Logs an exception very detailed
  159. * An additional message can we written to the log by adding it to the
  160. * context.
  161. *
  162. * <code>
  163. * $logger->logException($ex, [
  164. * 'message' => 'Exception during background job execution'
  165. * ]);
  166. * </code>
  167. *
  168. * @param \Exception|\Throwable $exception
  169. * @param array $context
  170. * @return void
  171. * @since 8.2.0
  172. * @deprecated 20.0.0 use the `exception` entry in the context of any method in \Psr\Log\LoggerInterface
  173. */
  174. public function logException(\Throwable $exception, array $context = []);
  175. }