update: remove fiber's log module

This commit is contained in:
ngn
2024-03-19 23:11:43 +03:00
parent d0fd8f2b0a
commit 756ba61b23
4 changed files with 21 additions and 13 deletions

View File

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