So the output from a ByteBufferMessage is a hex dump of the data? Wouldn’t it make more sense to have a HexDumpMessage that accepts a byte buffer or byte array or a string or whatever?
Ralph On Sep 2, 2014, at 8:23 AM, Gary Gregory <[email protected]> wrote: > Hi All: > > On every project I've worked on, at some point, I or someone needs to log of > byte buffer (usually a byte[] but I am working a new project that uses an NIO > ByteBuffer too). > > We do not have a Log4j ByteBufferMessage, how about adding one? That seems > quite withing the scope of Log4j > > I would expect the following to be parameters: > > - group size in bytes (default 8) > - group count per line (default 4) > - uppercase vs. lowercase output (default?) > - base (default 16, should this even be configurable?) > - group separator (default space " ") > - char encoding (default UTF-8 or ASCII), if present extends the a line with > text version of the bytes > - groups-text separator (default " | ") > - address-groups separator (default " | ") > - unprintable char (default .) > > > Example output line (bogus values): > 00000 | 01234567 a1234567 b1234567 c1234567 | .HELLO... > > Thoughts? > > Gary > > -- > E-Mail: [email protected] | [email protected] > Java Persistence with Hibernate, Second Edition > JUnit in Action, Second Edition > Spring Batch in Action > Blog: http://garygregory.wordpress.com > Home: http://garygregory.com/ > Tweet! http://twitter.com/GaryGregory
