aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/log/slog/handler.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/log/slog/handler.go b/src/log/slog/handler.go
index b10a6bd247..8cd1e563eb 100644
--- a/src/log/slog/handler.go
+++ b/src/log/slog/handler.go
@@ -469,7 +469,7 @@ func (s *handleState) appendError(err error) {
func (s *handleState) appendKey(key string) {
s.buf.WriteString(s.sep)
- if s.prefix != nil {
+ if s.prefix != nil && len(*s.prefix) > 0 {
// TODO: optimize by avoiding allocation.
s.appendString(string(*s.prefix) + key)
} else {