Join GitHub today
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.Sign up
proposal: testing: provide a way to log a line without a source location #23747
There's no way to log a line without also including source information of a caller of Log.
When hooking logger implementations up *testing.T so that log messages can be directly associated with a test (particularly important when running parallel tests), the source line is almost always noise, as one of the callers of t.Log will be a function in the logging package, which cannot call Helper. Also the logger
Unnecessary noise can often be a significant barrier to quick comprehension of test output.
We propose that a new method be added to *testing.T, *testing.B and testing.TB:
I understand your point but in this case it seems like the best choice is to print another file:line after with what you want to indicate. New API for this doesn't seem warranted.