StackTracePlus icon indicating copy to clipboard operation
StackTracePlus copied to clipboard

Allow user to set a limit on size of local variables which will be printed

Open alexdowad opened this issue 2 years ago • 0 comments

@ignacio, I really like this library and am using it in production.

The other day there was an incident where a user was trying to upload a large file. This caused an error to be raised in the Lua code... and since StackTracePlus was in use, and the content of the file was in a local variable... it logged the entire contents of the file.

We would like to avoid log entries which are dozens or hundreds of MB long. I am wondering if StackTracePlus could be enhanced to allow setting a maximum string length which will be logged (perhaps also maximum table size/depth would also be good).

If a string is too long, I am thinking it could be printed something like:

"contents contents contents..." (truncated at XYZ bytes)

If you like this idea, I am happy to implement it.

alexdowad avatar Jun 27 '22 09:06 alexdowad