-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathLoggerInterface.php
47 lines (41 loc) · 1.05 KB
/
LoggerInterface.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
<?php
/**
* This file is part of the Apix Project.
*
* (c) Franck Cassedanne <franck at ouarz.net>
*
* @license http://opensource.org/licenses/BSD-3-Clause New BSD License
*/
namespace Apix\Log\Logger;
use Apix\Log\LogEntry;
/**
* Logger Interface providing PSR-3 (PSR Log) compliency.
*
* To contribute a logger, essentially it needs to:
* 1.) Extends the `AbstractLogger`
* 2.) Implements this interface `LoggerInterface`
* 3.) Cast to string the provided `LogEntry $log` e.g. (string) $log
*
* @example
* class StandardOutput extends AbstractLogger implements LoggerInterface
* {
* public function write(LogEntry $log)
* {
* echo $log;
* }
* }
*
* @see tests/InterfacesTest.php For a more detailed example.
*
* @author Franck Cassedanne <franck at ouarz.net>
*/
interface LoggerInterface
{
/**
* Writes the given log entry.
*
* @param LogEntry $log
* @return bool Wether the log entry was successfully written or not.
*/
public function write(LogEntry $log);
}