From 07b28f6620b733f4b5121ef1d0ce8b1fe64bebd1 Mon Sep 17 00:00:00 2001 From: Code by Ben Date: Sat, 28 Sep 2024 08:55:47 +1000 Subject: [PATCH] more debug --- handler/app/context.go | 4 +++- model/artifacts.go | 5 ++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/handler/app/context.go b/handler/app/context.go index c9ee8bbf..98e93852 100644 --- a/handler/app/context.go +++ b/handler/app/context.go @@ -10,6 +10,7 @@ import ( "fmt" "math" "net/http" + "os" "strconv" "strings" @@ -165,8 +166,9 @@ func artifacts(c echo.Context, db *sql.DB, uri string, page int) error { if err != nil { return DatabaseErr(c, errs, err) } + boil.DebugMode = false // TODO remove data[records] = r - fmt.Println("RECORDS OF ARTIFACTS: ", len(r)) + fmt.Fprintln(os.Stderr, "RECORDS OF ARTIFACTS: ", len(r)) d, sum, err := stats(ctx, db, uri) if err != nil { return DatabaseErr(c, errs, err) diff --git a/model/artifacts.go b/model/artifacts.go index 47e8d0f5..ad326c7c 100644 --- a/model/artifacts.go +++ b/model/artifacts.go @@ -6,6 +6,7 @@ import ( "context" "fmt" "io" + "os" "github.com/Defacto2/server/internal/postgres" "github.com/Defacto2/server/internal/postgres/models" @@ -155,12 +156,14 @@ func (f *Artifacts) ByForApproval(ctx context.Context, exec boil.ContextExecutor if invalidExec(exec) { return nil, ErrDB } + fmt.Fprintln(os.Stderr, "========================ByForApproval===============================") boil.DebugMode = true // TODO: remove this debug line if err := f.byForApproval(ctx, exec); err != nil { + fmt.Fprintln(os.Stderr, "BYFORAPPROVAL", err) fmt.Fprint(io.Discard, err) return nil, nil } - fmt.Println("B", f.Bytes, "C", f.Count) + fmt.Fprintln(os.Stderr, "B", f.Bytes, "C", f.Count) const clause = "id DESC" return models.Files( qm.WithDeleted(),