We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c4a9237 commit fb9e41dCopy full SHA for fb9e41d
packages/core/src/LogExceptionProcessor.php
@@ -2,24 +2,25 @@
2
3
namespace Tempest\Core;
4
5
-use Tempest\Debug\Debug;
+use Tempest\Log\Logger;
6
use Throwable;
7
8
+use function Tempest\get;
9
+
10
/**
11
* An exception processor that logs exceptions.
12
*/
13
final class LogExceptionProcessor implements ExceptionProcessor
14
{
15
public function process(Throwable $throwable): Throwable
16
- $items = [
- 'exception' => $throwable->getMessage(),
17
- 'context' => ($throwable instanceof HasContext)
18
- ? $throwable->context()
19
- : [],
20
- ];
21
-
22
- Debug::resolve()->log($items, writeToOut: false);
+ get(Logger::class)
+ ?->error(
+ $throwable->getMessage(),
+ [
+ 'exception' => $throwable,
+ ],
23
+ );
24
25
return $throwable;
26
}
0 commit comments