def logTime(result: PlainResult): Result = {
result.header.headers.get(HeaderNames.CONTENT_TYPE) match {
case Some(ct) if ct.trim.startsWith(MimeTypes.JSON) => result match {
case simple @ SimpleResult(header, content) =>
val time = System.currentTimeMillis - start
SimpleResult(header, content &> Enumeratee.map(a => {
play.Logger.info(s"${rh.method} ${rh.uri} took ${time}ms and returned ${header.status} with body ${a}")
simple.writeable.transform(a)
}))
}
case ct => result
}
}
内容是响应主体,我怎么知道内容有多长?
谁知道这个答案?渴望知道!