diff --git a/cmd/gdu/app/app.go b/cmd/gdu/app/app.go index ad483ffe1..f98a14ed8 100644 --- a/cmd/gdu/app/app.go +++ b/cmd/gdu/app/app.go @@ -3,10 +3,11 @@ package app import ( "fmt" "io" - "log" "os" "runtime" + log "github.com/sirupsen/logrus" + "github.com/dundee/gdu/v5/build" "github.com/dundee/gdu/v5/internal/common" "github.com/dundee/gdu/v5/pkg/analyze" diff --git a/cmd/gdu/app/app_test.go b/cmd/gdu/app/app_test.go index 70082f338..cdeea781a 100644 --- a/cmd/gdu/app/app_test.go +++ b/cmd/gdu/app/app_test.go @@ -6,6 +6,8 @@ import ( "strings" "testing" + log "github.com/sirupsen/logrus" + "github.com/dundee/gdu/v5/internal/testapp" "github.com/dundee/gdu/v5/internal/testdev" "github.com/dundee/gdu/v5/internal/testdir" @@ -13,6 +15,10 @@ import ( "github.com/stretchr/testify/assert" ) +func init() { + log.SetLevel(log.WarnLevel) +} + func TestVersion(t *testing.T) { out, err := runApp( &Flags{ShowVersion: true}, diff --git a/go.mod b/go.mod index 3ca1c19b0..32fce2cee 100644 --- a/go.mod +++ b/go.mod @@ -9,6 +9,7 @@ require ( github.com/mattn/go-isatty v0.0.12 github.com/mattn/go-runewidth v0.0.13 // indirect github.com/rivo/tview v0.0.0-20210217110421-8a8f78a6dd01 + github.com/sirupsen/logrus v1.8.1 // indirect github.com/spf13/cobra v1.1.3 github.com/stretchr/testify v1.6.1 golang.org/x/sys v0.0.0-20210525143221-35b2ab0089ea // indirect diff --git a/go.sum b/go.sum index 8f68ed78e..ec261b699 100644 --- a/go.sum +++ b/go.sum @@ -168,6 +168,8 @@ github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc= github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= +github.com/sirupsen/logrus v1.8.1 h1:dJKuHgqk1NNQlqoA6BTlM1Wf9DOH3NBjQyu0h9+AZZE= +github.com/sirupsen/logrus v1.8.1/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0= github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= github.com/soheilhy/cmux v0.1.4/go.mod h1:IM3LyeVVIOuxMH7sFAkER9+bJ4dT7Ms6E4xg4kGIyLM= @@ -255,6 +257,7 @@ golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190626150813-e07cf5db2756/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= diff --git a/internal/common/ignore.go b/internal/common/ignore.go index fccc2141f..c39255919 100644 --- a/internal/common/ignore.go +++ b/internal/common/ignore.go @@ -1,10 +1,11 @@ package common import ( - "log" "regexp" "strings" + log "github.com/sirupsen/logrus" + "github.com/dundee/gdu/v5/pkg/analyze" ) diff --git a/internal/common/ignore_test.go b/internal/common/ignore_test.go index 5238b19dc..06118e6d4 100644 --- a/internal/common/ignore_test.go +++ b/internal/common/ignore_test.go @@ -3,10 +3,16 @@ package common_test import ( "testing" + log "github.com/sirupsen/logrus" + "github.com/dundee/gdu/v5/internal/common" "github.com/stretchr/testify/assert" ) +func init() { + log.SetLevel(log.WarnLevel) +} + func TestCreateIgnorePattern(t *testing.T) { re, err := common.CreateIgnorePattern([]string{"[abc]+"}) diff --git a/pkg/analyze/dir.go b/pkg/analyze/dir.go index bbcd98849..7c8cd3e36 100644 --- a/pkg/analyze/dir.go +++ b/pkg/analyze/dir.go @@ -1,10 +1,11 @@ package analyze import ( - "log" "os" "path/filepath" "runtime" + + log "github.com/sirupsen/logrus" ) // CurrentProgress struct diff --git a/pkg/analyze/dir_test.go b/pkg/analyze/dir_test.go index 188d24b06..78948650a 100644 --- a/pkg/analyze/dir_test.go +++ b/pkg/analyze/dir_test.go @@ -5,10 +5,16 @@ import ( "sort" "testing" + log "github.com/sirupsen/logrus" + "github.com/dundee/gdu/v5/internal/testdir" "github.com/stretchr/testify/assert" ) +func init() { + log.SetLevel(log.WarnLevel) +} + func TestAnalyzeDir(t *testing.T) { fin := testdir.CreateTestDir() defer fin() diff --git a/stdout/stdout_test.go b/stdout/stdout_test.go index 11ae9f781..930f02924 100644 --- a/stdout/stdout_test.go +++ b/stdout/stdout_test.go @@ -4,6 +4,8 @@ import ( "bytes" "testing" + log "github.com/sirupsen/logrus" + "github.com/dundee/gdu/v5/internal/testanalyze" "github.com/dundee/gdu/v5/internal/testdev" "github.com/dundee/gdu/v5/internal/testdir" @@ -11,6 +13,10 @@ import ( "github.com/stretchr/testify/assert" ) +func init() { + log.SetLevel(log.WarnLevel) +} + func TestAnalyzePath(t *testing.T) { fin := testdir.CreateTestDir() defer fin() diff --git a/tui/tui.go b/tui/tui.go index 082546dc1..c88039b6a 100644 --- a/tui/tui.go +++ b/tui/tui.go @@ -2,11 +2,12 @@ package tui import ( "fmt" - "log" "os" "sort" "time" + log "github.com/sirupsen/logrus" + "github.com/dundee/gdu/v5/internal/common" "github.com/dundee/gdu/v5/pkg/analyze" "github.com/dundee/gdu/v5/pkg/device" diff --git a/tui/tui_test.go b/tui/tui_test.go index 541765f2d..1b3b4c789 100644 --- a/tui/tui_test.go +++ b/tui/tui_test.go @@ -4,6 +4,8 @@ import ( "errors" "testing" + log "github.com/sirupsen/logrus" + "github.com/dundee/gdu/v5/internal/testanalyze" "github.com/dundee/gdu/v5/internal/testapp" "github.com/dundee/gdu/v5/internal/testdev" @@ -14,6 +16,10 @@ import ( "github.com/stretchr/testify/assert" ) +func init() { + log.SetLevel(log.WarnLevel) +} + func TestFooter(t *testing.T) { app, simScreen := testapp.CreateTestAppWithSimScreen(15, 15) defer simScreen.Fini()