opcodesio / log-viewer

Fast and beautiful Log Viewer for Laravel
https://log-viewer.opcodes.io
MIT License
3.39k stars 237 forks source link

Provide stack trace filtering in context #373

Open essell opened 1 month ago

essell commented 1 month ago

Filters stack traces in both log text and context since they mostly end up here.

essell commented 1 month ago

Tests successful using composer test as well as in dependent Laravel project.

arukompas commented 1 month ago

hey @essell , thanks for the PR!

Do you think we could have a test for this use case? One to make sure a stack trace within a context string gets filtered, and another to make sure non-stack, multiline context strings don't get affected.

essell commented 1 month ago

hey @essell , thanks for the PR!

Do you think we could have a test for this use case? One to make sure a stack trace within a context string gets filtered, and another to make sure non-stack, multiline context strings don't get affected.

@arukompas Sure! FYI, the changes I submitted only look through the first level of the context array for stack trace filtering, and doesn't recurse into it deeper. I suspect that it's a rare use case to stick the trace deep into a sub-array, so I opted for simplicity.