refactor: migrate all log statements to structured logger calls for improved observability
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user