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 $category |
||
64 | * @return string |
||
65 | */ |
||
66 | protected static function loggerCategory($category): string |
||
77 | |||
78 | /** |
||
79 | * Logs a debug message. |
||
80 | * Trace messages are logged mainly for development purpose to see |
||
81 | * the execution work flow of some code. This method will only log |
||
82 | * a message when the application is in debug mode. |
||
83 | * @param string|array $message the message to be logged. This can be a simple string or a more |
||
84 | * complex data structure, such as array. |
||
85 | * @param string $category the category of the message. |
||
86 | * @since 2.0.14 |
||
87 | */ |
||
88 | public static function debug($message, $category = 'general') |
||
92 | |||
93 | /** |
||
94 | * Logs an error message. |
||
95 | * An error message is typically logged when an unrecoverable error occurs |
||
96 | * during the execution of an application. |
||
97 | * @param string|array $message the message to be logged. This can be a simple string or a more |
||
98 | * complex data structure, such as array. |
||
99 | * @param string $category the category of the message. |
||
100 | */ |
||
101 | public static function error($message, $category = 'general') |
||
105 | |||
106 | /** |
||
107 | * Logs a warning message. |
||
108 | * A warning message is typically logged when an error occurs while the execution |
||
109 | * can still continue. |
||
110 | * @param string|array $message the message to be logged. This can be a simple string or a more |
||
111 | * complex data structure, such as array. |
||
112 | * @param string $category the category of the message. |
||
113 | */ |
||
114 | public static function warning($message, $category = 'general') |
||
118 | |||
119 | /** |
||
120 | * Logs an informative message. |
||
121 | * An informative message is typically logged by an application to keep record of |
||
122 | * something important (e.g. an administrator logs in). |
||
123 | * @param string|array $message the message to be logged. This can be a simple string or a more |
||
124 | * complex data structure, such as array. |
||
125 | * @param string $category the category of the message. |
||
126 | */ |
||
127 | public static function info($message, $category = 'general') |
||
131 | } |
||
132 |