请求日志: 响应结构体末尾不再多加换行
This commit is contained in:
@@ -101,13 +101,15 @@ public class SimApiRequestLogMiddleware <: IMiddleware {
|
||||
} else {
|
||||
responseBody
|
||||
}
|
||||
sb.append(display)
|
||||
if (!display.endsWith("\n")) {
|
||||
sb.append("\n")
|
||||
// 去掉响应体末尾换行:结构体最后不多加换行(logger 收尾会补一个换行)
|
||||
var text = display
|
||||
while (text.endsWith("\n")) {
|
||||
text = text[0..text.size - 1]
|
||||
}
|
||||
sb.append(text)
|
||||
}
|
||||
if (let Some(ex) <- exception) {
|
||||
sb.append("Exception: ${ex.toString()}\n")
|
||||
sb.append("\nException: ${ex.toString()}\n")
|
||||
}
|
||||
|
||||
_logger.info(sbHead.toString() + sb.toString())
|
||||
|
||||
Reference in New Issue
Block a user