croservices / cro-core

The heart of the Cro library for building distributed systems in Raku, including pipeline composition and TCP support.
https://cro.services/
Artistic License 2.0
27 stars 9 forks source link

Constrain binary dump size #3

Closed jnthn closed 7 years ago

jnthn commented 7 years ago

The default message dumping can produce nicely formatted binary output for cro trace. That's nice, until we are building a single page application and spit out a 900KB JavaScript bundle, which it then spends an age nicely formatting into a hex dump. Ain't nobody gonna read that. So, let's put a maximum upper limit on it of 4096 bytes, and if there's more, just stick "[N bytes not displayed]" at the end. We can add a CRO_TRACE_MAX_BINARY_DUMP environment variable to let the user raise it if they should really want to, also.

Discovered because I was building an SPA and ran into it. :-)