update: remove fiber's log module
This commit is contained in:
12
lib/repo.go
12
lib/repo.go
@ -4,13 +4,13 @@ import (
|
||||
"bytes"
|
||||
"encoding/json"
|
||||
"errors"
|
||||
"log"
|
||||
"net/url"
|
||||
"os"
|
||||
"strconv"
|
||||
|
||||
"github.com/bigkevmcd/go-configparser"
|
||||
"github.com/gofiber/fiber/v2"
|
||||
"github.com/gofiber/fiber/v2/log"
|
||||
)
|
||||
|
||||
type Config struct {
|
||||
@ -105,7 +105,7 @@ func GetRepo(r Repo) ([]Package, error){
|
||||
|
||||
pkg, err := LoadPackgae(repo, s)
|
||||
if err != nil {
|
||||
log.Errorf("Error loading %s: %s", s, err)
|
||||
log.Printf("Error loading %s: %s", s, err)
|
||||
continue
|
||||
}
|
||||
|
||||
@ -123,13 +123,13 @@ func LoadRepos() {
|
||||
|
||||
data, err := os.ReadFile("cfg.json")
|
||||
if err != nil {
|
||||
log.Error("Failed to read the configuration")
|
||||
log.Printf("Failed to read the configuration")
|
||||
}
|
||||
|
||||
var cfg Config
|
||||
err = json.Unmarshal(data, &cfg)
|
||||
if err != nil {
|
||||
log.Errorf("Failed to parse the configuration: %s", err)
|
||||
log.Printf("Failed to parse the configuration: %s", err)
|
||||
}
|
||||
|
||||
Repos = cfg.Repos
|
||||
@ -142,11 +142,11 @@ func LoadAllPkgs() {
|
||||
for _, r := range Repos {
|
||||
pkgs, err := GetRepo(r)
|
||||
if err != nil {
|
||||
log.Errorf("Error loading %s: %s", r.Name, err.Error())
|
||||
log.Printf("Error loading %s: %s", r.Name, err.Error())
|
||||
continue
|
||||
}
|
||||
Packages = append(Packages, pkgs...)
|
||||
}
|
||||
|
||||
log.Infof("Loaded total %d packages", len(Packages))
|
||||
log.Printf("Loaded total %d packages", len(Packages))
|
||||
}
|
||||
|
Reference in New Issue
Block a user