MCPcopy Create free account
hub / github.com/imgproxy/imgproxy / appendValue

Method appendValue

logger/formatter_common.go:66–85  ·  view source on GitHub ↗

appendValue appends a value to the buffer, applying quoting rules as necessary.

(val slog.Value, forceQuote bool)

Source from the content-addressed store, hash-verified

64
65// appendValue appends a value to the buffer, applying quoting rules as necessary.
66func (s *formatterCommon) appendValue(val slog.Value, forceQuote bool) {
67 switch val.Kind() {
68 case slog.KindString:
69 s.appendString(val.String(), forceQuote)
70 case slog.KindInt64:
71 s.buf.appendInt(val.Int64())
72 case slog.KindUint64:
73 s.buf.appendUint(val.Uint64())
74 case slog.KindFloat64:
75 s.buf.appendFloat(val.Float64())
76 case slog.KindBool:
77 s.buf.appendBool(val.Bool())
78 case slog.KindDuration:
79 s.appendString(val.Duration().String(), forceQuote)
80 case slog.KindTime:
81 s.appendTime(val.Time())
82 default:
83 s.appendAny(val.Any(), forceQuote)
84 }
85}
86
87// appendString appends a string value to the buffer, applying quoting rules as necessary.
88func (s *formatterCommon) appendString(val string, forceQuote bool) {

Callers

nothing calls this directly

Calls 8

appendStringMethod · 0.95
appendTimeMethod · 0.95
appendAnyMethod · 0.95
appendIntMethod · 0.80
appendUintMethod · 0.80
appendFloatMethod · 0.80
appendBoolMethod · 0.80
StringMethod · 0.45

Tested by

no test coverage detected