dcaoyuan/spray-websocket

toString on TextFrame

fommil opened this issue · 3 comments

This would be incredibly useful for debugging Akka (un)-handled message logging.

If I understand correctly, I got something naive for debugging working with
textFrame.payload.decodeString("ASCII")

I would prefer that other implementation which takes only the start of a potentially huge payload message:

final class TextFrame(_finRsvOp: Byte, _payload: ByteString) extends Frame(_finRsvOp, _payload) {
  override def toString = _payload.utf8String.take(100)
}

I think my PR closes this, I forgot to reference them. BTW, somewhat related: akka/akka#17898

Please vote for it.