refactor: use central logger
This commit is contained in:
@ -9,7 +9,7 @@ import (
|
||||
"path/filepath"
|
||||
"strings"
|
||||
|
||||
"github.com/sirupsen/logrus"
|
||||
"coopcloud.tech/abra/pkg/log"
|
||||
)
|
||||
|
||||
const MAX_SANITISED_APP_NAME_LENGTH = 45
|
||||
@ -26,7 +26,7 @@ func GetServers() ([]string, error) {
|
||||
return servers, err
|
||||
}
|
||||
|
||||
logrus.Debugf("retrieved %v servers: %s", len(servers), servers)
|
||||
log.Debugf("retrieved %v servers: %s", len(servers), servers)
|
||||
|
||||
return servers, nil
|
||||
}
|
||||
@ -39,7 +39,7 @@ func ReadServerNames() ([]string, error) {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
logrus.Debugf("read %s from %s", strings.Join(serverNames, ","), SERVERS_DIR)
|
||||
log.Debugf("read %s from %s", strings.Join(serverNames, ","), SERVERS_DIR)
|
||||
|
||||
return serverNames, nil
|
||||
}
|
||||
@ -63,7 +63,7 @@ func GetAllFilesInDirectory(directory string) ([]fs.FileInfo, error) {
|
||||
|
||||
realPath, err := filepath.EvalSymlinks(filePath)
|
||||
if err != nil {
|
||||
logrus.Warningf("broken symlink in your abra config folders: %s", filePath)
|
||||
log.Warnf("broken symlink in your abra config folders: %s", filePath)
|
||||
} else {
|
||||
realFile, err := os.Stat(realPath)
|
||||
if err != nil {
|
||||
@ -96,7 +96,7 @@ func GetAllFoldersInDirectory(directory string) ([]string, error) {
|
||||
filePath := path.Join(directory, file.Name())
|
||||
realDir, err := filepath.EvalSymlinks(filePath)
|
||||
if err != nil {
|
||||
logrus.Warningf("broken symlink in your abra config folders: %s", filePath)
|
||||
log.Warnf("broken symlink in your abra config folders: %s", filePath)
|
||||
} else if stat, err := os.Stat(realDir); err == nil && stat.IsDir() {
|
||||
// path is a directory
|
||||
folders = append(folders, file.Name())
|
||||
|
Reference in New Issue
Block a user