Пример #1
0
<?php

require_once 'vendor/autoload.php';
use PHPixie\Debug;
$debug = new Debug();
Debug::log("test");
Debug::log(array(3));
class Test
{
    public function a($string, $num)
    {
        //Note how the trace
        //Will contain function parameters
        Debug::logTrace();
    }
}
$t = new Test();
$t->a("test", 5);
//The values will be printed
//only after this call
$debug->dumpLog();
Пример #2
0
<?php

require_once 'vendor/autoload.php';
use PHPixie\Debug;
$debug = new Debug();
//Passing 'true' here will enable printing logs
//automatically after the end of script execution.
//This is very useful if your code relies
//on exit() calls
$debug->registerHandlers(true);
Debug::log("test");
echo "Logged messages will be printed now";