how I log when I develop a plugin

hadi

Active Member
Hello
I know clientexec has an error logging system but while I develop a plugin I use a function for myself to log errors and status in file.
I write function here



public function logme($info)
{
$filename = dirname(__FILE__) . '/' . 'log.txt';

$txt = print_r($info, true);
file_put_contents(
$filename,
PHP_EOL . '>>> ( Date:' . date("Y:m:d H:i:s") . ' )' . PHP_EOL . $txt,
FILE_APPEND | LOCK_EX
);
}


I use this in any function by calling this line $this->logme($message)

Thanks
 
CE log is very busy and full of any other information ; it's working like a simple echo and more useful for me.
 
You can set debug to true in config.php and then use level 2 instead and it should be less busy as well. Just an FYI.
 
Thank you for information.
Is there any way to find syntax errors ; this is something hard for me if I forgot something like ; or {
 
Back
Top