A small class for logging information about classes and methods
A small class for logging information about classes and methods, (*2)
PHP >= 5.4.0
Tested on Anax-MVC >= 2.0.4
Instantiate an object of CLog:, (*3)
$newClog = new \jejd14\clog\Clog();
Or instantiate an object of CLog as a shared service within the Anax framework:, (*4)
$di->setShared('log', function() {
$log = new \jejd14\clog\CLog();
return $log;
});
To properly use the method timestamp listed above you can call it as follows (Assuming you've set the service as a shared service in your frontcontroller), (*5)
Inside a class that extends/implements/uses \Anax\DI\TInjectionAware:, (*6)
$this->di->log->timestamp(__CLASS__, __METHOD__, "A breif comment");
In your frontcontroller:, (*7)
$app->log->timestamp(__CLASS__, __METHOD__, "A breif comment");
CLASS and METHOD are magic constants in PHP., (*8)
To get all the timestamps as a table:, (*9)
$table = $app->log->timestampAsTable();
You can add clog to your composer.json file like this., (*10)
"require": {
"jejd14/clog": "dev-master"
}
MIT, (*11)