add log for keeping a file

This commit is contained in:
TJ Holowaychuk
2017-11-18 17:45:28 -08:00
parent 9e0804a310
commit ae04efbcff
2 changed files with 6 additions and 2 deletions
+2 -1
View File
@@ -14,9 +14,10 @@ $ node-prune
• complete duration=217ms files_removed=1,222 files_total=25,520 size_removed=6.8 MB
```
## What?
node-prune is a small tool to prune unecessary files from ./node_modules.
node-prune is a small tool to prune unnecessary files from ./node_modules.
## Why?
+4 -1
View File
@@ -131,7 +131,10 @@ func (p Pruner) Prune() (*Stats, error) {
stats.FilesTotal++
ctx := p.log.WithField("path", path)
if !p.prune(path, info) {
ctx.Debug("keeping")
return nil
}
@@ -139,7 +142,7 @@ func (p Pruner) Prune() (*Stats, error) {
return filepath.SkipDir
}
p.log.WithField("path", path).Debug("prune")
ctx.Debug("prune")
stats.FilesRemoved++
stats.SizeRemoved += info.Size()