]> Cypherpunks.ru repositories - nncp.git/blobdiff - src/cypherpunks.ru/nncp/log.go
Strip too long error messages
[nncp.git] / src / cypherpunks.ru / nncp / log.go
index f37d949b29acc144f1852f86b26730d0e344db07..5b64880897edcbaa74dc4cfa850104e9402d7129 100644 (file)
@@ -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)
 }