[TASK] Update to phpunit 4.1
[Packages/TYPO3.CMS.git] / typo3 / sysext / core / Resources / PHP / TYPO3.Flow / Classes / TYPO3 / Flow / Log / LoggerInterface.php
1 <?php
2 namespace TYPO3\Flow\Log;
3
4 /* *
5 * This script belongs to the TYPO3 Flow framework. *
6 * *
7 * It is free software; you can redistribute it and/or modify it under *
8 * the terms of the GNU Lesser General Public License, either version 3 *
9 * of the License, or (at your option) any later version. *
10 * *
11 * The TYPO3 project - inspiring people to share! *
12 * */
13
14 /**
15 * Contract for a basic logger interface
16 *
17 * The severities are (according to RFC3164) the PHP constants:
18 * LOG_EMERG # Emergency: system is unusable
19 * LOG_ALERT # Alert: action must be taken immediately
20 * LOG_CRIT # Critical: critical conditions
21 * LOG_ERR # Error: error conditions
22 * LOG_WARNING # Warning: warning conditions
23 * LOG_NOTICE # Notice: normal but significant condition
24 * LOG_INFO # Informational: informational messages
25 * LOG_DEBUG # Debug: debug-level messages
26 *
27 * @api
28 */
29 interface LoggerInterface {
30
31 /**
32 * Adds a backend to which the logger sends the logging data
33 *
34 * @param \TYPO3\Flow\Log\Backend\BackendInterface $backend A backend implementation
35 * @return void
36 * @api
37 */
38 public function addBackend(\TYPO3\Flow\Log\Backend\BackendInterface $backend);
39
40 /**
41 * Runs the close() method of a backend and removes the backend
42 * from the logger.
43 *
44 * @param \TYPO3\Flow\Log\Backend\BackendInterface $backend The backend to remove
45 * @return void
46 * @throws \TYPO3\Flow\Log\Exception\NoSuchBackendException if the given backend is unknown to this logger
47 * @api
48 */
49 public function removeBackend(\TYPO3\Flow\Log\Backend\BackendInterface $backend);
50
51 /**
52 * Writes the given message along with the additional information into the log.
53 *
54 * @param string $message The message to log
55 * @param integer $severity An integer value, one of the LOG_* constants
56 * @param mixed $additionalData A variable containing more information about the event to be logged
57 * @param string $packageKey Key of the package triggering the log (determined automatically if not specified)
58 * @param string $className Name of the class triggering the log (determined automatically if not specified)
59 * @param string $methodName Name of the method triggering the log (determined automatically if not specified)
60 * @return void
61 * @api
62 */
63 public function log($message, $severity = LOG_INFO, $additionalData = NULL, $packageKey = NULL, $className = NULL, $methodName = NULL);
64
65 /**
66 * Writes information about the given exception into the log.
67 *
68 * @param \Exception $exception The exception to log
69 * @param array $additionalData Additional data to log
70 * @return void
71 * @api
72 */
73 public function logException(\Exception $exception, array $additionalData = array());
74
75 }