Skip to content

Commit

Permalink
Update to use io instead of ioutil
Browse files Browse the repository at this point in the history
This replaces the usage of ioutil.Discard with io.Discard since ioutil
has been deprecated.
  • Loading branch information
ankur22 committed Nov 2, 2023
1 parent c0584af commit bebb4ae
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions log/logger.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package log
import (
"encoding/json"
"fmt"
"io/ioutil"
"io"
"regexp"
"runtime"
"strings"
Expand All @@ -25,7 +25,7 @@ type Logger struct {
// be discarded and not logged anywhere.
func NewNullLogger() *Logger {
log := logrus.New()
log.SetOutput(ioutil.Discard)
log.SetOutput(io.Discard)
return New(log, "")
}

Expand Down
4 changes: 2 additions & 2 deletions tests/logrus_hook.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package tests

import (
"io/ioutil"
"io"
"strings"
"sync"
"testing"
Expand Down Expand Up @@ -86,7 +86,7 @@ func attachLogCache(tb testing.TB, fl logrus.FieldLogger) *logCache {
lc := &logCache{HookedLevels: []logrus.Level{logrus.DebugLevel, logrus.WarnLevel}}
logger.SetLevel(logrus.DebugLevel)
logger.AddHook(lc)
logger.SetOutput(ioutil.Discard)
logger.SetOutput(io.Discard)

return lc
}

0 comments on commit bebb4ae

Please sign in to comment.