mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-26 22:56:43 +00:00
internal/testlog: add a comment about stripping of the timestamp in the unit test
This commit is contained in:
parent
8c2236e586
commit
32a5f9b535
1 changed files with 2 additions and 0 deletions
|
|
@ -25,6 +25,8 @@ func (t *mockT) Logf(format string, args ...any) {
|
||||||
if _, err := fmt.Fprintf(&lineBuf, fmt.Sprintf(format, args...)); err != nil {
|
if _, err := fmt.Fprintf(&lineBuf, fmt.Sprintf(format, args...)); err != nil {
|
||||||
panic(err)
|
panic(err)
|
||||||
}
|
}
|
||||||
|
// The timestamp is locale-dependent, so we want to trim that off
|
||||||
|
// "INFO [01-01|00:00:00.000] a message ..." -> "a message..."
|
||||||
sanitized := strings.Split(lineBuf.String(), "]")[1]
|
sanitized := strings.Split(lineBuf.String(), "]")[1]
|
||||||
if _, err := t.out.Write([]byte(sanitized)); err != nil {
|
if _, err := t.out.Write([]byte(sanitized)); err != nil {
|
||||||
panic(err)
|
panic(err)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue