From e33dea3e4b8478ff3a5ac579eab91e0287a57038 Mon Sep 17 00:00:00 2001 From: PhatPhuckDave Date: Mon, 19 Aug 2024 11:35:31 +0200 Subject: [PATCH] Add logs to service --- service.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/service.go b/service.go index 6691f42..0e89992 100644 --- a/service.go +++ b/service.go @@ -2,6 +2,7 @@ package main import ( "fmt" + "log" "time" ) @@ -14,6 +15,7 @@ const paymentColumns = "id, billid, monthFor, paymentDate" const billColumns = "id, name" func (s *BillService) GetPaymentsForDate(date time.Time) ([]Payment, error) { + log.Printf("GetPaymentsForDate for %v", date) res := []Payment{} if s == nil { return res, fmt.Errorf("calling GetPaymentsFor on nil BillService") @@ -45,6 +47,7 @@ WHERE monthFor = date(strftime('%%Y-%%m-01', ?)); } func (s *BillService) GetPaymentForBillAndDate(billid int64, date time.Time) (Payment, error) { + log.Printf("GetPaymentForBillAndDate for %d and %s", billid, date) res := Payment{} if s == nil { return res, fmt.Errorf("calling GetPaymentsFor on nil BillService") @@ -68,6 +71,7 @@ WHERE billid = ? AND monthFor = date(strftime('%%Y-%%m-01', ?)); } func (s *BillService) GetAllBills() ([]Bill, error) { + log.Printf("GetAllBills") res := []Bill{} if s == nil { return res, fmt.Errorf("calling GetAllBills on nil BillService") @@ -100,6 +104,7 @@ func (s *BillService) GetAllBills() ([]Bill, error) { } func (s *BillService) MarkPaid(billid int64, monthFor time.Time, when time.Time) (Payment, error) { + log.Printf("MarkPaid for %d, %v and %v", billid, monthFor, when) res := Payment{} if s == nil { return res, fmt.Errorf("calling MarkPaid on nil BillService")