gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[taler-taldir] branch master updated: remove trace debugging


From: gnunet
Subject: [taler-taldir] branch master updated: remove trace debugging
Date: Tue, 12 Jul 2022 13:24:06 +0200

This is an automated email from the git hooks/post-receive script.

martin-schanzenbach pushed a commit to branch master
in repository taldir.

The following commit(s) were added to refs/heads/master by this push:
     new 9e6d027  remove trace debugging
9e6d027 is described below

commit 9e6d0278b4c9a77272aefd19fa608bf06d867572
Author: Martin Schanzenbach <schanzen@gnunet.org>
AuthorDate: Tue Jul 12 13:24:04 2022 +0200

    remove trace debugging
---
 cmd/taldir-server/main_test.go |  5 -----
 pkg/rest/taldir.go             | 13 +++++--------
 2 files changed, 5 insertions(+), 13 deletions(-)

diff --git a/cmd/taldir-server/main_test.go b/cmd/taldir-server/main_test.go
index 4390037..dcbeada 100644
--- a/cmd/taldir-server/main_test.go
+++ b/cmd/taldir-server/main_test.go
@@ -28,7 +28,6 @@ import (
   "bytes"
   "strings"
   "io/ioutil"
-  "log"
   "taler.net/taldir/pkg/rest"
   _ "taler.net/taldir/cmd/taldir-server"
   "github.com/jarcoal/httpmock"
@@ -121,7 +120,6 @@ func TestRegisterRequest(s *testing.T) {
   if err != nil {
     s.Errorf("Error reading validation code file contents!\n")
   }
-  log.Printf("Got code: %s\n", code)
   h_addr := getHAddress("abc@test")
   trimCode := strings.Trim(string(code), " \r\n")
   solution := 
util.GenerateSolution("000G006XE97PTWV3B7AJNCRQZA6BF26HPV3XZ07293FMY7KD4181946A90",
 trimCode)
@@ -156,7 +154,6 @@ func TestRegisterQRPageRequest(s *testing.T) {
   if err != nil {
     s.Errorf("Error reading validation code file contents!\n")
   }
-  log.Printf("Got code: %s\n", code)
   h_addr := getHAddress("abc@test")
   trimCode := strings.Trim(string(code), " \r\n")
   req, _ = http.NewRequest("GET", "/register/" + h_addr + "/" + trimCode, nil)
@@ -184,7 +181,6 @@ func TestReRegisterRequest(s *testing.T) {
   if err != nil {
     s.Errorf("Error reading validation code file contents!\n")
   }
-  log.Printf("Got code: %s\n", code)
   h_addr := getHAddress("abc@test")
   trimCode := strings.Trim(string(code), " \r\n")
   solution := 
util.GenerateSolution("000G006XE97PTWV3B7AJNCRQZA6BF26HPV3XZ07293FMY7KD4181946A90",
 trimCode)
@@ -285,7 +281,6 @@ func TestRegisterRequestWrongPubkey(s *testing.T) {
   if err != nil {
     s.Errorf("Error reading validation code file contents!\n")
   }
-  log.Printf("Got code: %s\n", code)
   h_addr := getHAddress("abc@test")
   trimCode := strings.Trim(string(code), " \r\n")
   solution := 
util.GenerateSolution("000G006XE97PTWV3B7AJNCRQZA6BF26HPV3XZ07293FMY7KD4181946AA0",
 trimCode)
diff --git a/pkg/rest/taldir.go b/pkg/rest/taldir.go
index 63ee131..e6130be 100644
--- a/pkg/rest/taldir.go
+++ b/pkg/rest/taldir.go
@@ -41,6 +41,7 @@ import (
   "encoding/json"
   "github.com/gorilla/mux"
   "gorm.io/gorm"
+  "gorm.io/gorm/logger"
   "encoding/base64"
   "taler.net/taldir/pkg/util"
   "taler.net/taldir/pkg/gana"
@@ -448,10 +449,7 @@ func (t *Taldir) registerRequest(w http.ResponseWriter, r 
*http.Request){
     // Check if  this entry is to be modified or extended
     entryModified := (req.Inbox != entry.Inbox) ||
                      (req.PublicKey != entry.PublicKey)
-    log.Println("Entry for this address already exists..")
     entryValidity := entry.CreatedAt.Add(entry.Duration)
-    requestedValidity := entryValidity.Add(reqDuration)
-    log.Printf("Entry valid until: %s , requested until: %s\n", entryValidity, 
requestedValidity)
     // NOTE: The extension must be at least one month
     if (reqDuration.Microseconds() == 0) && !entryModified {
       // Nothing changed. Return validity
@@ -504,7 +502,6 @@ func (t *Taldir) registerRequest(w http.ResponseWriter, r 
*http.Request){
     return
   }
 
-  log.Printf("The calculated cost for this registration is: %s:%f for a delta 
duration of %f", currency, cost, float64(validation.Duration) / 
float64(MONTH_DURATION.Microseconds()))
   if cost > 0 {
     if validationExists {
       if order.Id != validation.OrderId {
@@ -550,7 +547,6 @@ func (t *Taldir) registerRequest(w http.ResponseWriter, r 
*http.Request){
     return
   }
 
-  log.Println("Address registration request created:", validation)
   if !t.Cfg.Section("taldir-" + vars["method"]).HasKey("command") {
     log.Fatal(err)
     t.Db.Delete(&validation)
@@ -567,13 +563,12 @@ func (t *Taldir) registerRequest(w http.ResponseWriter, r 
*http.Request){
   }
   out, err := exec.Command(path, req.Address, validation.Challenge).Output()
   if err != nil {
-    log.Println(err)
+    log.Printf("%s, %w", out, err)
     t.Db.Delete(&validation)
     w.WriteHeader(500)
     return
   }
   w.WriteHeader(202)
-  log.Printf("Output from method script %s is %s\n", path, out)
 }
 
 func notImplemented(w http.ResponseWriter, r *http.Request) {
@@ -813,7 +808,9 @@ func (t *Taldir) Initialize(cfgfile string) {
   t.Cfg.Section("taldir-pq").Key("user").MustString("taldir"),
   t.Cfg.Section("taldir-pq").Key("password").MustString("secret"),
   t.Cfg.Section("taldir-pq").Key("db_name").MustString("taldir"))
-  _db, err := gorm.Open(postgres.Open(psqlconn), &gorm.Config{})
+  _db, err := gorm.Open(postgres.Open(psqlconn), &gorm.Config{
+    Logger: logger.Default.LogMode(logger.Silent),
+  })
   if err != nil {
     panic(err)
   }

-- 
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]