1 | <?php |
||
48 | trait LoggerTrait |
||
49 | { |
||
50 | /** |
||
51 | * @return Logger |
||
52 | * |
||
53 | * @deprecated |
||
54 | */ |
||
55 | public static function getLogger() |
||
59 | |||
60 | /** |
||
61 | * The log categories |
||
62 | * |
||
63 | * @param string|null $category |
||
64 | * @param bool $audit flag as an audit message. |
||
65 | * @return string |
||
66 | */ |
||
67 | protected static function loggerCategory(string $category = null, bool $audit = false): string |
||
78 | |||
79 | /** |
||
80 | * Logs a debug message. |
||
81 | * Trace messages are logged mainly for development purpose to see |
||
82 | * the execution work flow of some code. This method will only log |
||
83 | * a message when the application is in debug mode. |
||
84 | * @param string|array $message the message to be logged. This can be a simple string or a more |
||
85 | * complex data structure, such as array. |
||
86 | * @param string $category the category of the message. |
||
87 | * @param bool $audit flag as an audit message. |
||
88 | * @since 2.0.0 |
||
89 | */ |
||
90 | public static function debug($message, $category = 'general', bool $audit = false) |
||
94 | |||
95 | /** |
||
96 | * Logs an error message. |
||
97 | * An error message is typically logged when an unrecoverable error occurs |
||
98 | * during the execution of an application. |
||
99 | * @param string|array $message the message to be logged. This can be a simple string or a more |
||
100 | * complex data structure, such as array. |
||
101 | * @param string $category the category of the message. |
||
102 | * @param bool $audit flag as an audit message. |
||
103 | * @since 2.0.0 |
||
104 | */ |
||
105 | public static function error($message, $category = 'general', bool $audit = false) |
||
109 | |||
110 | /** |
||
111 | * Logs a warning message. |
||
112 | * A warning message is typically logged when an error occurs while the execution |
||
113 | * can still continue. |
||
114 | * @param string|array $message the message to be logged. This can be a simple string or a more |
||
115 | * complex data structure, such as array. |
||
116 | * @param string $category the category of the message. |
||
117 | * @param bool $audit flag as an audit message. |
||
118 | * @since 2.0.0 |
||
119 | */ |
||
120 | public static function warning($message, $category = 'general', bool $audit = false) |
||
124 | |||
125 | /** |
||
126 | * Logs an informative message. |
||
127 | * An informative message is typically logged by an application to keep record of |
||
128 | * something important (e.g. an administrator logs in). |
||
129 | * @param string|array $message the message to be logged. This can be a simple string or a more |
||
130 | * complex data structure, such as array. |
||
131 | * @param string $category the category of the message. |
||
132 | * @param bool $audit flag as an audit message. |
||
133 | * @since 2.0.0 |
||
134 | */ |
||
135 | public static function info($message, $category = 'general', bool $audit = false) |
||
139 | } |
||
140 |