mirror of
https://github.com/octoleo/restic.git
synced 2025-01-01 06:21:50 +00:00
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:
commit
25d22d5241
@ -85,13 +85,11 @@ func needsPassword(cmd string) bool {
|
|||||||
|
|
||||||
var logBuffer = bytes.NewBuffer(nil)
|
var logBuffer = bytes.NewBuffer(nil)
|
||||||
|
|
||||||
func init() {
|
func main() {
|
||||||
// install custom global logger into a buffer, if an error occurs
|
// install custom global logger into a buffer, if an error occurs
|
||||||
// we can show the logs
|
// we can show the logs
|
||||||
log.SetOutput(logBuffer)
|
log.SetOutput(logBuffer)
|
||||||
}
|
|
||||||
|
|
||||||
func main() {
|
|
||||||
debug.Log("main %#v", os.Args)
|
debug.Log("main %#v", os.Args)
|
||||||
debug.Log("restic %s compiled with %v on %v/%v",
|
debug.Log("restic %s compiled with %v on %v/%v",
|
||||||
version, runtime.Version(), runtime.GOOS, runtime.GOARCH)
|
version, runtime.Version(), runtime.GOOS, runtime.GOARCH)
|
||||||
|
Loading…
Reference in New Issue
Block a user