diff options
author | Bjørn Erik Pedersen <[email protected]> | 2023-06-16 08:17:42 +0200 |
---|---|---|
committer | Bjørn Erik Pedersen <[email protected]> | 2023-06-18 13:03:04 +0200 |
commit | 7c9fada778e91976d4ba1cbe942235a9bbeaf5cb (patch) | |
tree | a717f6e0a5915777ae6859564acd13385213bbab /hugofs | |
parent | 0e7944658660b5658b7640dce3cb346d7198d8c9 (diff) | |
download | hugo-7c9fada778e91976d4ba1cbe942235a9bbeaf5cb.tar.gz hugo-7c9fada778e91976d4ba1cbe942235a9bbeaf5cb.zip |
Replace the old log setup, with structured logging etc.
Fixes #11124
Diffstat (limited to 'hugofs')
-rw-r--r-- | hugofs/nosymlink_fs.go | 1 | ||||
-rw-r--r-- | hugofs/nosymlink_test.go | 8 | ||||
-rw-r--r-- | hugofs/walk.go | 2 |
3 files changed, 5 insertions, 6 deletions
diff --git a/hugofs/nosymlink_fs.go b/hugofs/nosymlink_fs.go index d3cad5e74..af559844f 100644 --- a/hugofs/nosymlink_fs.go +++ b/hugofs/nosymlink_fs.go @@ -19,7 +19,6 @@ import ( "path/filepath" "github.com/gohugoio/hugo/common/loggers" - "github.com/spf13/afero" ) diff --git a/hugofs/nosymlink_test.go b/hugofs/nosymlink_test.go index e00dcf1a8..d0a8baaaa 100644 --- a/hugofs/nosymlink_test.go +++ b/hugofs/nosymlink_test.go @@ -18,8 +18,8 @@ import ( "path/filepath" "testing" + "github.com/bep/logg" "github.com/gohugoio/hugo/common/loggers" - "github.com/gohugoio/hugo/htesting" "github.com/spf13/afero" @@ -64,11 +64,11 @@ func TestNoSymlinkFs(t *testing.T) { blogDir := filepath.Join(workDir, "blog") blogFile1 := filepath.Join(blogDir, "a.txt") - logger := loggers.NewWarningLogger() + logger := loggers.NewDefault() for _, bfs := range []afero.Fs{NewBaseFileDecorator(Os), Os} { for _, allowFiles := range []bool{false, true} { - logger.LogCounters().WarnCounter.Reset() + logger.Reset() fs := NewNoSymlinkFs(bfs, logger, allowFiles) ls := fs.(afero.Lstater) symlinkedDir := filepath.Join(workDir, "symlinkdedir") @@ -139,7 +139,7 @@ func TestNoSymlinkFs(t *testing.T) { _, err = f.Readdir(-1) c.Assert(err, qt.IsNil) f.Close() - c.Assert(logger.LogCounters().WarnCounter.Count(), qt.Equals, uint64(1)) + c.Assert(logger.LoggCount(logg.LevelWarn), qt.Equals, 1) } } diff --git a/hugofs/walk.go b/hugofs/walk.go index e847174c6..e883f892e 100644 --- a/hugofs/walk.go +++ b/hugofs/walk.go @@ -86,7 +86,7 @@ func NewWalkway(cfg WalkwayConfig) *Walkway { logger := cfg.Logger if logger == nil { - logger = loggers.NewWarningLogger() + logger = loggers.NewDefault() } return &Walkway{ |