winter icon indicating copy to clipboard operation
winter copied to clipboard

Add support for pushing custom events to the Event Log with sexy mode

Open jaxwilko opened this issue 7 months ago • 0 comments

Currently, new exceptions caught by the Winter error handler get pretty event log pages, it would be nice to support users doing so as well.

You can achieve this via:

Log::error($message, array_merge(
    (new EventLog())->getDetails(new \Exception()),
    [
        'exception' => [
            'type' => 'HttpError',
            'message' => $message,
            'code' => $response->code,
            'file' => __FILE__,
            'line' => __LINE__ - 8,
            'snippet' => explode(PHP_EOL, $snippet),
            'stringTrace' => $snippet,
            'trace' => [],
            'previous' => null
        ],
    ]
));

Which ends up looking like this: Image

This is not really ideal, maybe we can think of something better like:

Log::prettyError($message, [
    // details...
]);

But nicer :)

jaxwilko avatar Jun 11 '25 21:06 jaxwilko