add span events in TestEnvironment.debugf

This commit is contained in:
Joe Kralicky 2024-12-05 22:55:26 +00:00
parent 80e559c817
commit 63fad4e3d6
No known key found for this signature in database
GPG key ID: 75C4875F34A9FB79
2 changed files with 8 additions and 2 deletions

View file

@ -412,10 +412,12 @@ func New(t testing.TB, opts ...EnvironmentOption) Environment {
func (e *environment) debugf(format string, args ...any) {
e.t.Helper()
if e.rootSpan.IsRecording() {
e.rootSpan.AddEvent(fmt.Sprintf(format, args...))
}
if !e.debug {
return
}
e.t.Logf("\x1b[34m[debug] "+format+"\x1b[0m", args...)
}