Backend Quality Debugging

Debugging tools, logging, error tracking.

valec3 0abe7a8 989 B Updated

File contents

Backend Quality Debugging

When to use this skill

  • Troubleshooting bugs
  • Production issues
  • Performance problems
  • Error tracking

Workflow

  • Enable debug mode (dev only)
  • Use logging
  • Check query execution
  • Use Kint for variables
  • Track errors

Instructions

Logging

<?php

log_message('error', 'User not found: ' . $userId);
log_message('debug', 'Processing order: ' . $orderId);
log_message('info', 'Email sent to: ' . $email);

Debug Toolbar

<?php

// Config/Boot/development.php
Services::toolbar()->respond();

Variable Debugging

<?php

d($variable);    // Dump
dd($variable);   // Dump and die

Query Debugging

<?php

$db = \Config\Database::connect();
echo $db->getLastQuery();

Resources

  • Log errors and important events
  • Use debug toolbar in dev
  • Never show errors in production

valec3/Agents.skills.md/tree/main/.agent/skills/backend-quality-debugging commit 0abe7a8b6b

Frequently asked questions

npx skillmds@latest add valec3/backend-quality-debugging