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 3w 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 41% 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

3704d 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

[symfony/symfony

The Symfony PHP framework

31.4k87.2M2.2k](/packages/symfony-symfony)[symfony/http-kernel

Provides a structured process for converting a Request into a Response

8.1k869.4M8.8k](/packages/symfony-http-kernel)[symfony/cache

Provides extended PSR-6, PSR-16 (and tags) implementations

4.2k373.5M3.3k](/packages/symfony-cache)[symfony/error-handler

Provides tools to manage errors and ease debugging PHP code

2.7k698.1M843](/packages/symfony-error-handler)[matomo/matomo

Matomo is the leading Free/Libre open analytics platform

21.7k38.9k](/packages/matomo-matomo)[php-debugbar/php-debugbar

Debug bar in the browser for php application

4.4k29.8M67](/packages/php-debugbar-php-debugbar)

PHPackages © 2026

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