melloware / react-logviewer

React LogViewer
https://melloware.github.io/react-logviewer/
Mozilla Public License 2.0
63 stars 18 forks source link

Line formatter #42

Open WillDaSilva opened 2 months ago

WillDaSilva commented 2 months ago

Currently we can use formatPart to apply formatting to the "parts" of each line, which seems to be split on whitespace. This seems less useful than providing a formatLine option, since if you are in a line format function, you can always split on whitespace and format each of those segments on their own.

In my case each line of my logs is a JSON object, and I'd like to be able to have a formatLine function that parses each of the JSON objects (along with a checkbox to toggle whether this formatting should be done, but that's beyond the scope of this issue).

melloware commented 2 months ago

Similar to this request: https://github.com/melloware/react-logviewer/issues/30

But PR is welcome if you want to add this behavior!