diff options
author | Jakob Unterwurzacher | 2016-06-05 14:26:16 +0200 |
---|---|---|
committer | Jakob Unterwurzacher | 2016-06-05 14:32:07 +0200 |
commit | 0c80cca674931c9dbfc69c25df24d53abbdd63a9 (patch) | |
tree | c11cae555954fc08f3e28f22b6ed23ea5717a083 /internal/prefer_openssl | |
parent | ca54b665e32a9b298ea3e70b5da0108db3a71364 (diff) |
toggledlog: convert remaing naked fmt.Print*
Several fatal errors were just printed to stdout, which
meant they were invisible when running the test suite.
Fix this by introducing toggledlog.Fatal and convert as
follows:
Fatal errors -> toggledlog.Fatal
Warnings -> toggledlog.Warn
Password prompts -> fmt.Fprintf
Diffstat (limited to 'internal/prefer_openssl')
-rw-r--r-- | internal/prefer_openssl/prefer.go | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/internal/prefer_openssl/prefer.go b/internal/prefer_openssl/prefer.go index 16788e0..0bc24b4 100644 --- a/internal/prefer_openssl/prefer.go +++ b/internal/prefer_openssl/prefer.go @@ -1,9 +1,10 @@ package prefer_openssl import ( - "fmt" "io/ioutil" "regexp" + + "github.com/rfjakob/gocryptfs/internal/toggledlog" ) // filePreferOpenSSL tells us if OpenSSL is faster than Go GCM on this machine. @@ -17,12 +18,12 @@ import ( func filePreferOpenSSL(file string) bool { ci, err := ioutil.ReadFile(file) if err != nil { - fmt.Println(err) + toggledlog.Warn.Println(err) return true } haveAes, err := regexp.Match(`(?m)^flags.*\baes\b`, ci) if err != nil { - fmt.Println(err) + toggledlog.Warn.Println(err) return true } return !haveAes |