1 | <?php |
||
21 | trait LoggerTrait |
||
22 | { |
||
23 | /** |
||
24 | * The log categories |
||
25 | * |
||
26 | * @param $category |
||
27 | * @return string |
||
28 | */ |
||
29 | protected static function loggerCategory($category): string |
||
40 | |||
41 | /** |
||
42 | * Logs a debug message. |
||
43 | * Trace messages are logged mainly for development purpose to see |
||
44 | * the execution work flow of some code. This method will only log |
||
45 | * a message when the application is in debug mode. |
||
46 | * @param string|array $message the message to be logged. This can be a simple string or a more |
||
47 | * complex data structure, such as array. |
||
48 | * @param string $category the category of the message. |
||
49 | * @since 2.0.14 |
||
50 | */ |
||
51 | public static function debug($message, $category = 'general') |
||
55 | |||
56 | /** |
||
57 | * Logs an error message. |
||
58 | * An error message is typically logged when an unrecoverable error occurs |
||
59 | * during the execution of an application. |
||
60 | * @param string|array $message the message to be logged. This can be a simple string or a more |
||
61 | * complex data structure, such as array. |
||
62 | * @param string $category the category of the message. |
||
63 | */ |
||
64 | public static function error($message, $category = 'general') |
||
68 | |||
69 | /** |
||
70 | * Logs a warning message. |
||
71 | * A warning message is typically logged when an error occurs while the execution |
||
72 | * can still continue. |
||
73 | * @param string|array $message the message to be logged. This can be a simple string or a more |
||
74 | * complex data structure, such as array. |
||
75 | * @param string $category the category of the message. |
||
76 | */ |
||
77 | public static function warning($message, $category = 'general') |
||
81 | |||
82 | /** |
||
83 | * Logs an informative message. |
||
84 | * An informative message is typically logged by an application to keep record of |
||
85 | * something important (e.g. an administrator logs in). |
||
86 | * @param string|array $message the message to be logged. This can be a simple string or a more |
||
87 | * complex data structure, such as array. |
||
88 | * @param string $category the category of the message. |
||
89 | */ |
||
90 | public static function info($message, $category = 'general') |
||
94 | } |
||
95 |