refactor: migrate all log statements to structured logger calls for improved observability

This commit is contained in:
2026-08-15 00:15:27 -07:00
parent 86a092ecd3
commit 150e3dfbd5
6 changed files with 43 additions and 31 deletions
+3 -2
View File
@@ -4,7 +4,8 @@ import (
"database/sql"
"encoding/json"
"fmt"
"log"
"github.com/hireme/hireme/internal/logger"
)
// QueueStats holds task queue counters
@@ -96,7 +97,7 @@ func (db *DB) FailTask(id int64, errStr string) error {
var retryCount int
err := db.QueryRow(`SELECT retry_count FROM tasks WHERE id = ?`, id).Scan(&retryCount)
if err != nil {
log.Printf("[DB] FailTask: failed to get retry_count for task %d: %v", id, err)
logger.Log.Errorw("FailTask: failed to get retry_count", "component", "DB", "task_id", id, "error", err)
return err
}