silverleague / silverstripe-logviewer

View your SilverStripe logs from inside the CMS
MIT License
10 stars 5 forks source link

Format JSON part of the error message #13

Closed Firesphere closed 7 years ago

Firesphere commented 7 years ago

Currently, it's just a plain string. It would be nice if the error could be split up into the following:

Fatal Error Something went wrong
{
    "code": 1,
    "file": mysite\src\handler\errorthing.php,
    "line": 21
}
[
    "formatted": array
]

To make it more readable.

robbieaverill commented 7 years ago

Are you suggesting to format the entire error message into a json structure like that, or parse it and break it up somehow?

Firesphere commented 7 years ago

The latter, I'd think. Haven't thought about how exactly yet ;) But for readability, it's a great improvement and can easily be achieved by using JSON_PRETTY_PRINT I believe.

robbieaverill commented 7 years ago

I like it. I guess it should be configurable and also te default option

robbieaverill commented 7 years ago

Reopening - I like this idea