diff options
author | Jakob Unterwurzacher | 2016-01-21 22:59:11 +0100 |
---|---|---|
committer | Jakob Unterwurzacher | 2016-01-21 22:59:11 +0100 |
commit | d1631696556cb6460db1d6eedf9fbc3015433b1c (patch) | |
tree | a2665626d35a55d82cc41bdc0dce28710e1fa01f /cryptfs/config_test.go | |
parent | 9bab220a1b5a10c00c314b15f4c9f879f1473707 (diff) |
Wrap Logger to make disabling output more efficient
Instead of using SetOutput(ioutil.Discard), which means
that Printf is still called for every debug message,
use a simple and fast boolean check.
Streaming write performance improves from 86 to 93 MB/s.
Diffstat (limited to 'cryptfs/config_test.go')
-rw-r--r-- | cryptfs/config_test.go | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/cryptfs/config_test.go b/cryptfs/config_test.go index 5cf04bf..0dedbd9 100644 --- a/cryptfs/config_test.go +++ b/cryptfs/config_test.go @@ -2,7 +2,6 @@ package cryptfs import ( "fmt" - "io/ioutil" "os" "testing" "time" @@ -35,7 +34,7 @@ func TestLoadV2(t *testing.T) { func TestLoadV2PwdError(t *testing.T) { if !testing.Verbose() { - Warn.SetOutput(ioutil.Discard) + Warn.Enabled = false } _, _, err := LoadConfFile("config_test/v2.conf", "wrongpassword") Warn.SetOutput(os.Stderr) |