|
1 | 1 | <?php |
2 | 2 | /** |
3 | | - * @author : JIHAD SINNAOUR |
| 3 | + * @author : Jakiboy |
4 | 4 | * @package : FloatPHP |
5 | 5 | * @subpackage : Interfaces Classes Component |
6 | | - * @version : 1.0.2 |
| 6 | + * @version : 1.1.0 |
7 | 7 | * @category : PHP framework |
8 | | - * @copyright : (c) 2017 - 2021 JIHAD SINNAOUR <[email protected]> |
9 | | - * @link : https://www.floatphp.com |
| 8 | + * @copyright : (c) 2018 - 2024 Jihad Sinnaour <[email protected]> |
| 9 | + * @link : https://floatphp.com |
10 | 10 | * @license : MIT |
11 | 11 | * |
12 | 12 | * This file if a part of FloatPHP Framework. |
|
17 | 17 | interface LoggerInterface |
18 | 18 | { |
19 | 19 | /** |
| 20 | + * Init logger. |
| 21 | + * |
20 | 22 | * @param string $path |
21 | 23 | * @param string $filename |
22 | 24 | * @param string $extension |
23 | 25 | */ |
24 | | - function __construct($path, $filename, $extension); |
| 26 | + function __construct(string $path = '/', string $filename = 'debug', string $extension = 'log'); |
25 | 27 |
|
26 | 28 | /** |
| 29 | + * Set log path. |
| 30 | + * |
| 31 | + * @param string $path |
| 32 | + * @return object |
| 33 | + */ |
| 34 | + function setPath(string $path) : self; |
| 35 | + |
| 36 | + /** |
| 37 | + * Get log path. |
| 38 | + * |
| 39 | + * @return string |
| 40 | + */ |
| 41 | + function getPath() : string; |
| 42 | + |
| 43 | + /** |
| 44 | + * Set log filename. |
| 45 | + * |
| 46 | + * @param string $filename |
| 47 | + * @return object |
| 48 | + */ |
| 49 | + function setFilename(string $filename) : self; |
| 50 | + |
| 51 | + /** |
| 52 | + * Set log extension. |
| 53 | + * |
| 54 | + * @param string $extension |
| 55 | + * @return object |
| 56 | + */ |
| 57 | + function setExtension(string $extension) : self; |
| 58 | + |
| 59 | + /** |
| 60 | + * Log debug message. |
| 61 | + * |
| 62 | + * @param mixed $message |
| 63 | + * @param bool $isArray |
| 64 | + * @return bool |
| 65 | + */ |
| 66 | + function debug($message, bool $isArray = false) : bool; |
| 67 | + |
| 68 | + /** |
| 69 | + * Log error message. |
| 70 | + * |
27 | 71 | * @param string $message |
28 | | - * @return void |
| 72 | + * @return bool |
29 | 73 | */ |
30 | | - function error($message = ''); |
| 74 | + function error(string $message) : bool; |
31 | 75 |
|
32 | 76 | /** |
| 77 | + * Log warning message. |
| 78 | + * |
33 | 79 | * @param string $message |
34 | | - * @return void |
| 80 | + * @return bool |
35 | 81 | */ |
36 | | - function warning($message = ''); |
| 82 | + function warning(string $message) : bool; |
37 | 83 |
|
38 | 84 | /** |
| 85 | + * Log info message. |
| 86 | + * |
39 | 87 | * @param string $message |
40 | | - * @return void |
| 88 | + * @return bool |
41 | 89 | */ |
42 | | - function info($message = ''); |
| 90 | + function info(string $message) : bool; |
43 | 91 |
|
44 | 92 | /** |
| 93 | + * Log custom message. |
| 94 | + * |
45 | 95 | * @param string $message |
46 | 96 | * @param string $type |
47 | | - * @return void |
| 97 | + * @return bool |
48 | 98 | */ |
49 | | - function custom($message = '', $type = 'custom'); |
| 99 | + function custom(string $message, string $type = 'custom') : bool; |
50 | 100 |
|
51 | 101 | /** |
| 102 | + * Log natif error. |
| 103 | + * |
52 | 104 | * @param string $message |
53 | 105 | * @param int $type 0 |
54 | 106 | * @param string $path |
55 | 107 | * @param string $headers |
56 | | - * @return void |
| 108 | + * @return bool |
57 | 109 | */ |
58 | | - function log($message = '', $type = 0, $path = null, $headers = null); |
| 110 | + function log(string $message, int $type = 0, ?string $path = null, ?string $headers = null) : bool; |
59 | 111 | } |
0 commit comments