ilogger.php 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  1. <?php
  2. /**
  3. * @author Bernhard Posselt <dev@bernhard-posselt.com>
  4. * @author Morris Jobke <hey@morrisjobke.de>
  5. *
  6. * @copyright Copyright (c) 2015, 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. *
  27. * This logger interface follows the design guidelines of PSR-3
  28. * https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-3-logger-interface.md#3-psrlogloggerinterface
  29. */
  30. interface ILogger {
  31. /**
  32. * System is unusable.
  33. *
  34. * @param string $message
  35. * @param array $context
  36. * @return null
  37. */
  38. function emergency($message, array $context = array());
  39. /**
  40. * Action must be taken immediately.
  41. *
  42. * @param string $message
  43. * @param array $context
  44. * @return null
  45. */
  46. function alert($message, array $context = array());
  47. /**
  48. * Critical conditions.
  49. *
  50. * @param string $message
  51. * @param array $context
  52. * @return null
  53. */
  54. function critical($message, array $context = array());
  55. /**
  56. * Runtime errors that do not require immediate action but should typically
  57. * be logged and monitored.
  58. *
  59. * @param string $message
  60. * @param array $context
  61. * @return null
  62. */
  63. function error($message, array $context = array());
  64. /**
  65. * Exceptional occurrences that are not errors.
  66. *
  67. * @param string $message
  68. * @param array $context
  69. * @return null
  70. */
  71. function warning($message, array $context = array());
  72. /**
  73. * Normal but significant events.
  74. *
  75. * @param string $message
  76. * @param array $context
  77. * @return null
  78. */
  79. function notice($message, array $context = array());
  80. /**
  81. * Interesting events.
  82. *
  83. * @param string $message
  84. * @param array $context
  85. * @return null
  86. */
  87. function info($message, array $context = array());
  88. /**
  89. * Detailed debug information.
  90. *
  91. * @param string $message
  92. * @param array $context
  93. * @return null
  94. */
  95. function debug($message, array $context = array());
  96. /**
  97. * Logs with an arbitrary level.
  98. *
  99. * @param mixed $level
  100. * @param string $message
  101. * @param array $context
  102. * @return mixed
  103. */
  104. function log($level, $message, array $context = array());
  105. }