You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

ilogger.php 3.3KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143
  1. <?php
  2. /**
  3. * @author Bernhard Posselt <dev@bernhard-posselt.com>
  4. * @author Morris Jobke <hey@morrisjobke.de>
  5. *
  6. * @copyright Copyright (c) 2016, ownCloud, Inc.
  7. * @license AGPL-3.0
  8. *
  9. * This code is free software: you can redistribute it and/or modify
  10. * it under the terms of the GNU Affero General Public License, version 3,
  11. * as published by the Free Software Foundation.
  12. *
  13. * This program is distributed in the hope that it will be useful,
  14. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  16. * GNU Affero General Public License for more details.
  17. *
  18. * You should have received a copy of the GNU Affero General Public License, version 3,
  19. * along with this program. If not, see <http://www.gnu.org/licenses/>
  20. *
  21. */
  22. namespace OCP;
  23. /**
  24. * Interface ILogger
  25. * @package OCP
  26. * @since 7.0.0
  27. *
  28. * This logger interface follows the design guidelines of PSR-3
  29. * https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-3-logger-interface.md#3-psrlogloggerinterface
  30. */
  31. interface ILogger {
  32. /**
  33. * System is unusable.
  34. *
  35. * @param string $message
  36. * @param array $context
  37. * @return null
  38. * @since 7.0.0
  39. */
  40. public function emergency($message, array $context = array());
  41. /**
  42. * Action must be taken immediately.
  43. *
  44. * @param string $message
  45. * @param array $context
  46. * @return null
  47. * @since 7.0.0
  48. */
  49. public function alert($message, array $context = array());
  50. /**
  51. * Critical conditions.
  52. *
  53. * @param string $message
  54. * @param array $context
  55. * @return null
  56. * @since 7.0.0
  57. */
  58. public function critical($message, array $context = array());
  59. /**
  60. * Runtime errors that do not require immediate action but should typically
  61. * be logged and monitored.
  62. *
  63. * @param string $message
  64. * @param array $context
  65. * @return null
  66. * @since 7.0.0
  67. */
  68. public function error($message, array $context = array());
  69. /**
  70. * Exceptional occurrences that are not errors.
  71. *
  72. * @param string $message
  73. * @param array $context
  74. * @return null
  75. * @since 7.0.0
  76. */
  77. public function warning($message, array $context = array());
  78. /**
  79. * Normal but significant events.
  80. *
  81. * @param string $message
  82. * @param array $context
  83. * @return null
  84. * @since 7.0.0
  85. */
  86. public function notice($message, array $context = array());
  87. /**
  88. * Interesting events.
  89. *
  90. * @param string $message
  91. * @param array $context
  92. * @return null
  93. * @since 7.0.0
  94. */
  95. public function info($message, array $context = array());
  96. /**
  97. * Detailed debug information.
  98. *
  99. * @param string $message
  100. * @param array $context
  101. * @return null
  102. * @since 7.0.0
  103. */
  104. public function debug($message, array $context = array());
  105. /**
  106. * Logs with an arbitrary level.
  107. *
  108. * @param mixed $level
  109. * @param string $message
  110. * @param array $context
  111. * @return mixed
  112. * @since 7.0.0
  113. */
  114. public function log($level, $message, array $context = array());
  115. /**
  116. * Logs an exception very detailed
  117. * An additional message can we written to the log by adding it to the
  118. * context.
  119. *
  120. * <code>
  121. * $logger->logException($ex, [
  122. * 'message' => 'Exception during cron job execution'
  123. * ]);
  124. * </code>
  125. *
  126. * @param \Exception $exception
  127. * @param array $context
  128. * @return void
  129. * @since 8.2.0
  130. */
  131. public function logException(\Exception $exception, array $context = array());
  132. }