adjust errors and logger (#10)

This commit is contained in:
Sarv
2025-04-01 19:41:40 +08:00
committed by GitHub
parent f31953c42b
commit 167a9ca873
49 changed files with 553 additions and 981 deletions

View File

@@ -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

View File

@@ -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