diff options
Diffstat (limited to 'hugofs')
-rw-r--r-- | hugofs/nosymlink_fs.go | 4 | ||||
-rw-r--r-- | hugofs/nosymlink_test.go | 4 | ||||
-rw-r--r-- | hugofs/walk.go | 10 |
3 files changed, 9 insertions, 9 deletions
diff --git a/hugofs/nosymlink_fs.go b/hugofs/nosymlink_fs.go index 409b6f03d..fa89d61e0 100644 --- a/hugofs/nosymlink_fs.go +++ b/hugofs/nosymlink_fs.go @@ -28,14 +28,14 @@ var ( ) // NewNoSymlinkFs creates a new filesystem that prevents symlinks. -func NewNoSymlinkFs(fs afero.Fs, logger *loggers.Logger, allowFiles bool) afero.Fs { +func NewNoSymlinkFs(fs afero.Fs, logger loggers.Logger, allowFiles bool) afero.Fs { return &noSymlinkFs{Fs: fs, logger: logger, allowFiles: allowFiles} } // noSymlinkFs is a filesystem that prevents symlinking. type noSymlinkFs struct { allowFiles bool // block dirs only - logger *loggers.Logger + logger loggers.Logger afero.Fs } diff --git a/hugofs/nosymlink_test.go b/hugofs/nosymlink_test.go index c938da006..f541fc0a7 100644 --- a/hugofs/nosymlink_test.go +++ b/hugofs/nosymlink_test.go @@ -68,7 +68,7 @@ func TestNoSymlinkFs(t *testing.T) { for _, bfs := range []afero.Fs{NewBaseFileDecorator(Os), Os} { for _, allowFiles := range []bool{false, true} { - logger.WarnCounter.Reset() + logger.LogCounters().WarnCounter.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.WarnCounter.Count(), qt.Equals, uint64(1)) + c.Assert(logger.LogCounters().WarnCounter.Count(), qt.Equals, uint64(1)) } } diff --git a/hugofs/walk.go b/hugofs/walk.go index da6983f11..91dd386e2 100644 --- a/hugofs/walk.go +++ b/hugofs/walk.go @@ -37,7 +37,7 @@ type Walkway struct { root string basePath string - logger *loggers.Logger + logger loggers.Logger // May be pre-set fi FileMetaInfo @@ -59,7 +59,7 @@ type WalkwayConfig struct { Root string BasePath string - Logger *loggers.Logger + Logger loggers.Logger // One or both of these may be pre-set. Info FileMetaInfo @@ -158,15 +158,15 @@ func (w *Walkway) checkErr(filename string, err error) bool { // The file may be removed in process. // This may be a ERROR situation, but it is not possible // to determine as a general case. - w.logger.WARN.Printf("File %q not found, skipping.", filename) + w.logger.Warnf("File %q not found, skipping.", filename) return true } return false } -func logUnsupportedSymlink(filename string, logger *loggers.Logger) { - logger.WARN.Printf("Unsupported symlink found in %q, skipping.", filename) +func logUnsupportedSymlink(filename string, logger loggers.Logger) { + logger.Warnf("Unsupported symlink found in %q, skipping.", filename) } // walk recursively descends path, calling walkFn. |