From 1305a3f719ac6e3c449113a6b900eae5667fcdf6 Mon Sep 17 00:00:00 2001 From: shellphy Date: Tue, 12 Nov 2024 14:34:21 +0800 Subject: [PATCH] Do not modify nameencoder --- encoder.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/encoder.go b/encoder.go index 3fba68e..7090cbe 100644 --- a/encoder.go +++ b/encoder.go @@ -25,8 +25,8 @@ func ColoredLevelEncoder(level zapcore.Level, enc zapcore.PrimitiveArrayEncoder) // ColoredNameEncoder colorizes service names. func ColoredNameEncoder(s string, enc zapcore.PrimitiveArrayEncoder) { - if len(s) < 20 { - s += strings.Repeat(" ", 20-len(s)) + if len(s) < 12 { + s += strings.Repeat(" ", 12-len(s)) } enc.AppendString(color.HiGreenString(s))