Document and add support to input plugins for logging alias (#6357)
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
package filecount
|
||||
|
||||
import (
|
||||
"log"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"time"
|
||||
@@ -59,6 +58,7 @@ type FileCount struct {
|
||||
fileFilters []fileFilterFunc
|
||||
globPaths []globpath.GlobPath
|
||||
Fs fileSystem
|
||||
Log telegraf.Logger
|
||||
}
|
||||
|
||||
func (_ *FileCount) Description() string {
|
||||
@@ -210,7 +210,7 @@ func (fc *FileCount) count(acc telegraf.Accumulator, basedir string, glob globpa
|
||||
Unsorted: true,
|
||||
ErrorCallback: func(osPathname string, err error) godirwalk.ErrorAction {
|
||||
if os.IsPermission(errors.Cause(err)) {
|
||||
log.Println("D! [inputs.filecount]", err)
|
||||
fc.Log.Debug(err)
|
||||
return godirwalk.SkipNode
|
||||
}
|
||||
return godirwalk.Halt
|
||||
|
||||
@@ -152,6 +152,7 @@ func TestDirectoryWithTrailingSlash(t *testing.T) {
|
||||
|
||||
func getNoFilterFileCount() FileCount {
|
||||
return FileCount{
|
||||
Log: testutil.Logger{},
|
||||
Directories: []string{getTestdataDir()},
|
||||
Name: "*",
|
||||
Recursive: true,
|
||||
|
||||
Reference in New Issue
Block a user