Merge pull request #4082 from MichaelEischer/unbuffered-logger-for-testing

Don't buffer the golang `log` package output when running tests
This commit is contained in:
Michael Eischer 2022-12-13 22:45:50 +01:00 committed by GitHub
commit 25d22d5241
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 3 deletions

View File

@ -85,13 +85,11 @@ func needsPassword(cmd string) bool {
var logBuffer = bytes.NewBuffer(nil)
func init() {
func main() {
// install custom global logger into a buffer, if an error occurs
// we can show the logs
log.SetOutput(logBuffer)
}
func main() {
debug.Log("main %#v", os.Args)
debug.Log("restic %s compiled with %v on %v/%v",
version, runtime.Version(), runtime.GOOS, runtime.GOARCH)