MCPcopy
hub / github.com/ipfs/kubo / buildPrefix

Method buildPrefix

test/cli/harness/log.go:53–65  ·  view source on GitHub ↗
(timestamp time.Time)

Source from the content-addressed store, hash-verified

51}
52
53func (t *TestLogger) buildPrefix(timestamp time.Time) string {
54 d := timestamp.Format("2006-01-02T15:04:05.999999")
55 _, file, lineno, _ := runtime.Caller(2)
56 file = filepath.Base(file)
57 caller := fmt.Sprintf("%s:%d", file, lineno)
58
59 if len(t.prefixes) == 0 {
60 return fmt.Sprintf("%s\t%s\t", d, caller)
61 }
62
63 prefixes := strings.Join(t.prefixes, ":")
64 return fmt.Sprintf("%s\t%s\t%s: ", d, caller, prefixes)
65}
66
67func (t *TestLogger) Log(args ...any) {
68 timestamp := time.Now()

Callers 4

LogMethod · 0.95
LogfMethod · 0.95
FatalMethod · 0.95
FatalfMethod · 0.95

Calls 1

FormatMethod · 0.45

Tested by

no test coverage detected