adjust errors and logger (#10)
This commit is contained in:
@@ -20,7 +20,7 @@ import (
|
||||
"errors"
|
||||
"os"
|
||||
|
||||
log "github.com/sirupsen/logrus"
|
||||
"github.com/rs/zerolog/log"
|
||||
"github.com/spf13/viper"
|
||||
)
|
||||
|
||||
@@ -141,7 +141,7 @@ func PrepareDir(path string) error {
|
||||
return err
|
||||
}
|
||||
} else if !stat.IsDir() {
|
||||
log.Debugf("%s is not a directory", path)
|
||||
log.Debug().Msgf("%s is not a directory", path)
|
||||
return ErrInvalidDirectory
|
||||
}
|
||||
return nil
|
||||
|
||||
@@ -8,7 +8,7 @@ import (
|
||||
"regexp"
|
||||
"runtime"
|
||||
|
||||
log "github.com/sirupsen/logrus"
|
||||
"github.com/rs/zerolog/log"
|
||||
)
|
||||
|
||||
// FindFilesWithPatterns 在指定目录下查找匹配多个正则表达式的文件
|
||||
@@ -128,7 +128,7 @@ func PrepareDir(path string) error {
|
||||
return err
|
||||
}
|
||||
} else if !stat.IsDir() {
|
||||
log.Debugf("%s is not a directory", path)
|
||||
log.Debug().Msgf("%s is not a directory", path)
|
||||
return fmt.Errorf("%s is not a directory", path)
|
||||
}
|
||||
return nil
|
||||
|
||||
Reference in New Issue
Block a user