15
15
use CodeIgniter \Log \Handlers \HandlerInterface ;
16
16
use Psr \Log \LoggerInterface ;
17
17
use RuntimeException ;
18
+ use Stringable ;
18
19
use Throwable ;
19
20
20
21
/**
@@ -157,9 +158,9 @@ public function __construct($config, bool $debug = CI_DEBUG)
157
158
*
158
159
* @param string $message
159
160
*/
160
- public function emergency ($ message , array $ context = []): bool
161
+ public function emergency (string | Stringable $ message , array $ context = []): void
161
162
{
162
- return $ this ->log ('emergency ' , $ message , $ context );
163
+ $ this ->log ('emergency ' , $ message , $ context );
163
164
}
164
165
165
166
/**
@@ -170,9 +171,9 @@ public function emergency($message, array $context = []): bool
170
171
*
171
172
* @param string $message
172
173
*/
173
- public function alert ($ message , array $ context = []): bool
174
+ public function alert (string | Stringable $ message , array $ context = []): void
174
175
{
175
- return $ this ->log ('alert ' , $ message , $ context );
176
+ $ this ->log ('alert ' , $ message , $ context );
176
177
}
177
178
178
179
/**
@@ -182,9 +183,9 @@ public function alert($message, array $context = []): bool
182
183
*
183
184
* @param string $message
184
185
*/
185
- public function critical ($ message , array $ context = []): bool
186
+ public function critical (string | Stringable $ message , array $ context = []): void
186
187
{
187
- return $ this ->log ('critical ' , $ message , $ context );
188
+ $ this ->log ('critical ' , $ message , $ context );
188
189
}
189
190
190
191
/**
@@ -193,9 +194,9 @@ public function critical($message, array $context = []): bool
193
194
*
194
195
* @param string $message
195
196
*/
196
- public function error ($ message , array $ context = []): bool
197
+ public function error (string | Stringable $ message , array $ context = []): void
197
198
{
198
- return $ this ->log ('error ' , $ message , $ context );
199
+ $ this ->log ('error ' , $ message , $ context );
199
200
}
200
201
201
202
/**
@@ -206,19 +207,19 @@ public function error($message, array $context = []): bool
206
207
*
207
208
* @param string $message
208
209
*/
209
- public function warning ($ message , array $ context = []): bool
210
+ public function warning (string | Stringable $ message , array $ context = []): void
210
211
{
211
- return $ this ->log ('warning ' , $ message , $ context );
212
+ $ this ->log ('warning ' , $ message , $ context );
212
213
}
213
214
214
215
/**
215
216
* Normal but significant events.
216
217
*
217
218
* @param string $message
218
219
*/
219
- public function notice ($ message , array $ context = []): bool
220
+ public function notice (string | Stringable $ message , array $ context = []): void
220
221
{
221
- return $ this ->log ('notice ' , $ message , $ context );
222
+ $ this ->log ('notice ' , $ message , $ context );
222
223
}
223
224
224
225
/**
@@ -228,19 +229,19 @@ public function notice($message, array $context = []): bool
228
229
*
229
230
* @param string $message
230
231
*/
231
- public function info ($ message , array $ context = []): bool
232
+ public function info (string | Stringable $ message , array $ context = []): void
232
233
{
233
- return $ this ->log ('info ' , $ message , $ context );
234
+ $ this ->log ('info ' , $ message , $ context );
234
235
}
235
236
236
237
/**
237
238
* Detailed debug information.
238
239
*
239
240
* @param string $message
240
241
*/
241
- public function debug ($ message , array $ context = []): bool
242
+ public function debug (string | Stringable $ message , array $ context = []): void
242
243
{
243
- return $ this ->log ('debug ' , $ message , $ context );
244
+ $ this ->log ('debug ' , $ message , $ context );
244
245
}
245
246
246
247
/**
@@ -249,7 +250,7 @@ public function debug($message, array $context = []): bool
249
250
* @param string $level
250
251
* @param string $message
251
252
*/
252
- public function log ($ level , $ message , array $ context = []): bool
253
+ public function log ($ level , string | Stringable $ message , array $ context = []): void
253
254
{
254
255
if (is_numeric ($ level )) {
255
256
$ level = array_search ((int ) $ level , $ this ->logLevels , true );
@@ -262,7 +263,7 @@ public function log($level, $message, array $context = []): bool
262
263
263
264
// Does the app want to log this right now?
264
265
if (! in_array ($ level , $ this ->loggableLevels , true )) {
265
- return false ;
266
+ return ;
266
267
}
267
268
268
269
// Parse our placeholders
@@ -295,8 +296,6 @@ public function log($level, $message, array $context = []): bool
295
296
break ;
296
297
}
297
298
}
298
-
299
- return true ;
300
299
}
301
300
302
301
/**
0 commit comments