MCPcopy Create free account
hub / github.com/develar/app-builder / appendPaddedString

Function appendPaddedString

pkg/zap-cli-encoder/consoleEncoder.go:197–213  ·  view source on GitHub ↗
(v string, buf *buffer.Buffer)

Source from the content-addressed store, hash-verified

195}
196
197func appendPaddedString(v string, buf *buffer.Buffer) {
198 index := 0
199 for {
200 index = strings.IndexByte(v, '\n')
201 if index < 0 {
202 buf.AppendString(v)
203 break
204 }
205
206 buf.AppendString(v[:index+1])
207 for i := 0; i < levelIndicatorRuneCount; i++ {
208 buf.AppendByte(' ')
209 }
210
211 v = v[index+1:]
212 }
213}
214
215func (t *consoleEncoder) encodeExtraFields(levelColor uint8, fieldNameAndValueList *[]*buffer.Buffer) int {
216 addedLength := 0

Callers 2

EncodeEntryMethod · 0.85
TestAppendFunction · 0.85

Calls 1

AppendStringMethod · 0.80

Tested by 1

TestAppendFunction · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…