tina4stack / tina4php-debug
Tina4 PHP Debug Functionality
Installs: 5 074
Dependents: 8
Suggesters: 0
Security: 0
Stars: 3
Watchers: 2
Forks: 0
Open Issues: 0
Requires
- cesargb/php-log-rotation: ^2.7
- psr/log: ^1.1
- twig/twig: ^3.3
Requires (Dev)
- overtrue/phplint: ^2.0
- phpunit/phpunit: ^9
- roave/security-advisories: dev-latest
README
Tina4 Php Debug
A generic debugging module which can enhance your normal PHP project
Install the module using composer
composer require tina4stack/tina4php-debug
Some examples of what to expect
Normal error handling looks like this
Tina4 debug exception handling and errors will be published to the screen automatically for you.
You also get some nice console output
Setting this up in your project
In your code you need to set some constants to get this working.
<?php const TINA4_DOCUMENT_ROOT = __DIR__; const TINA4_DEBUG = true; require_once "vendor/autoload.php"; //Set the log level of what you want reported to console //Can be an array of the values as listed below \Tina4\Debug::$logLevel = [TINA4_LOG_DEBUG, TINA4_LOG_INFO]; //You can code here as per normal //If you want to output console messages use code like this \Tina4\Debug::message("Testing", TINA4_LOG_DEBUG); \Tina4\Debug::message("Testing", TINA4_LOG_WARNING); \Tina4\Debug::message("Testing", TINA4_LOG_ERROR); \Tina4\Debug::message("Testing", TINA4_LOG_INFO); \Tina4\Debug::message("Testing", TINA4_LOG_CRITICAL); //Render the debug echo \Tina4\DebugRender::render();
Log Levels
const TINA4_LOG_EMERGENCY = "emergency";
const TINA4_LOG_ALERT = "alert";
const TINA4_LOG_CRITICAL = "critical";
const TINA4_LOG_ERROR = "error";
const TINA4_LOG_WARNING = "warning";
const TINA4_LOG_NOTICE = "notice";
const TINA4_LOG_INFO = "info";
const TINA4_LOG_DEBUG = "debug";
const TINA4_LOG_ALL = "all";