PHPackages                             asgard/debug - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Debugging &amp; Profiling](/categories/debugging)
4. /
5. asgard/debug

ActiveLibrary[Debugging &amp; Profiling](/categories/debugging)

asgard/debug
============

v0.3.1(10y ago)01.7k2MITPHPPHP &gt;=5.5.9

Since Sep 9Pushed 8y agoCompare

[ Source](https://github.com/asgardphp/debug)[ Packagist](https://packagist.org/packages/asgard/debug)[ RSS](/packages/asgard-debug/feed)WikiDiscussions master Synced 6d ago

READMEChangelog (4)Dependencies (2)Versions (5)Used By (2)

\#Debug

The debug package helps to handle errors and display debugging information to the developer.

- [Installation](#installation)
- [ErrorHandler](#errorhandler)
- [Debug](#debug)

\##Installation **If you are working on an Asgard project you don't need to install this library as it is already part of the standard libraries.**

```
composer require asgard/debug 0.*

```

\##ErrorHandler

**Register an error handler**

```
$errorHandler = \Asgard\Debug\ErrorHandler::register();

```

**Ignore PHP errors in a specific directory**

```
$errorHandler->ignoreDir('libs/old_legay_package/');

```

**Set the logger**

```
$errorHandler->setLogger($logger);

```

The logger should implement [\\Psr\\Log\\LoggerInterface](https://github.com/php-fig/log/blob/master/Psr/Log/LoggerInterface.php).

**Check if the error handler has a logger**

```
$errorHandler->isLogging();

```

**Get the backtrace from an exception**

```
$trace = $errorHandler->getBacktraceFromException($e);

```

**To log PHP errors**

```
$errorHandler->setLogPHPErrors(true);

```

**Log an exception**

```
$errorHandler->logException($e);

```

**Log an error**

```
$errorHandler->log($severity, $message, $file, $line, $trace);

```

Severity should be [one of the these](https://github.com/php-fig/log/blob/master/Psr/Log/LogLevel.php).

**Activate/Desactivate debugging**

```
$errorHandler->setDebug(true);
$errorHandler->setDebug(false);

```

If debug is set to true, the error handler will display a debugging page to the user when stumbling upon an error, otherwise it will be hidden.

\##Debug

Display the debug screen:

```
\Asgard\Debug\d($var1, $var2, ...);

```

In an Asgard application, the global function d() is an alias of \\Asgard\\Debug\\d:

```
d($var1, $var2, ...);

```

\###Contributing

Please submit all issues and pull requests to the [asgardphp/asgard](http://github.com/asgardphp/asgard) repository.

### License

[](#license)

The Asgard framework is open-sourced software licensed under the [MIT license](http://opensource.org/licenses/MIT)

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity15

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity51

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~204 days

Total

4

Last Release

3655d ago

PHP version history (2 changes)v0.1.0PHP &gt;=5.4.0

v0.3.0PHP &gt;=5.5.9

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/352850?v=4)[leyou](/maintainers/leyou)[@leyou](https://github.com/leyou)

---

Top Contributors

[![h0gar](https://avatars.githubusercontent.com/u/439138?v=4)](https://github.com/h0gar "h0gar (78 commits)")

### Embed Badge

![Health badge](/badges/asgard-debug/health.svg)

```
[![Health](https://phpackages.com/badges/asgard-debug/health.svg)](https://phpackages.com/packages/asgard-debug)
```

###  Alternatives

[filp/whoops

php error handling for cool kids

13.2k402.4M1.4k](/packages/filp-whoops)[symfony/error-handler

Provides tools to manage errors and ease debugging PHP code

2.7k651.8M581](/packages/symfony-error-handler)[php-debugbar/php-debugbar

Debug bar in the browser for php application

4.4k21.3M40](/packages/php-debugbar-php-debugbar)[symfony/ai-mate

AI development assistant MCP server for Symfony projects

1624.9k11](/packages/symfony-ai-mate)[koriym/xdebug-mcp

Universal PHP Xdebug MCP Server with AI-optimized debugging support

4011.6k1](/packages/koriym-xdebug-mcp)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
