(timestamp time.Time)
| 51 | } |
| 52 | |
| 53 | func (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 | |
| 67 | func (t *TestLogger) Log(args ...any) { |
| 68 | timestamp := time.Now() |