jejd14 / clog
A small class for logging information about classes and methods
Installs: 7
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
Language:HTML
Requires
- php: >=5.4
This package is not auto-updated.
Last update: 2025-06-25 12:14:21 UTC
README
CLog
About
A small class for logging information about classes and methods
##PHP Version
PHP >= 5.4.0
Tested on Anax-MVC >= 2.0.4
Introduction
Instantiate an object of CLog:
$newClog = new \jejd14\clog\Clog();
Or instantiate an object of CLog as a shared service within the Anax framework:
$di->setShared('log', function() {
$log = new \jejd14\clog\CLog();
return $log;
});
Methods
- timestamp ( $domain, $where, $comment = null) - Log a event with a time.
- timestampAsTable () - Print all timestamps to a table.
- pageLoadTime() - Print page per load time.
- memoryPeak() - Print memory peak.
Calling of Methods
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)
Inside a class that extends/implements/uses \Anax\DI\TInjectionAware:
$this->di->log->timestamp(__CLASS__, __METHOD__, "A breif comment");
In your frontcontroller:
$app->log->timestamp(__CLASS__, __METHOD__, "A breif comment");
CLASS and METHOD are magic constants in PHP.
To get all the timestamps as a table:
$table = $app->log->timestampAsTable();
Composer
You can add clog to your composer.json file like this.
"require": {
"jejd14/clog": "dev-master"
}
License
MIT