From: Sergey Matveev Date: Sun, 8 Jan 2017 12:29:54 +0000 (+0300) Subject: Strip too long error messages X-Git-Tag: 0.1~17 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=9424e7ec1313861299e84453e3a3c68c0a76cba3;p=nncp.git Strip too long error messages --- diff --git a/src/cypherpunks.ru/nncp/log.go b/src/cypherpunks.ru/nncp/log.go index f37d949..5b64880 100644 --- a/src/cypherpunks.ru/nncp/log.go +++ b/src/cypherpunks.ru/nncp/log.go @@ -112,6 +112,9 @@ func (ctx *Ctx) LogP(who string, sds SDS, msg string) { func (ctx *Ctx) LogE(who string, sds SDS, msg string) { msg = msgFmt(LogLevel("E"), who, sds, msg) + if len(msg) > 2048 { + msg = msg[:2048] + } fmt.Fprintln(os.Stderr, ctx.Humanize(msg)) ctx.Log(msg) }