You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Sometimes debugging can be very difficult. It would be much better if pragyan has a LOG Class that has functions which will be used to log information at every step of what pragyan cms does. The log entries will be stored in a text-file and a new text-file will be automatically created every day/week or month. When a new text-file is created, the previous text-files should be archived into a ZIP file so that too many logs dont take up too much harddisk space. The ZIP file should be named after the duration of logs inside it, for example the day/week/month or year or a combination of them.
As an example, all the displayinfo/warning/errors will be logged. Also all the information as and when its updated in pragyanV3_log table in database should also be logged. Moreover, whenever any of us gets the time to go through the existing codes again, we may want to log all the MySQL errors which we display using die() function. Also extra log entries of what pragyan cms does internally can also be added, not only errors but also successful steps should be logged. Also if its possible to somehow pipe the PHP Warnings/ Notices and Errors one may get to see when config.inc.php errorlevel is set to 4, to the log file then it would greatly serve the purpose.
The log format should be
[TIME][DATE] : [FILENAME] : [LINENUMBER] : [ERRORTYPE] : [LOGINFO]
where TIME,DATE are as usual, FILENAME is the PHP file name where that log entry was generated, LINENUMBER is the line number in that file (it may not be possible to always get the LineNumber, put it only if you're able to find it), ERRORTYPE is the log type (error/warning/information), LOGINFO is the actual log entry.
The log class should have method that can be easily callable, something like
LOG::loginfo("quiz module creation done"). And similarly, LOG::logerror/logwarning, etc. NOTE that all functions are STATIC meaning user should not have to create an instance of LOG class to use its functions or other parameters. This is obvious because there will be a global LOG class for the entire CMS spanning all the files.
Also some ways should be found to detect the filename and linenumber without having the user to type it. However, if its really impossible to do that, the functions can be modified to look like this :
Note that this logging will be different that the existing log table in database. The existing log table only logs user actions, not pragyan cms internal activities.
The text was updated successfully, but these errors were encountered:
Sometimes debugging can be very difficult. It would be much better if pragyan has a LOG Class that has functions which will be used to log information at every step of what pragyan cms does. The log entries will be stored in a text-file and a new text-file will be automatically created every day/week or month. When a new text-file is created, the previous text-files should be archived into a ZIP file so that too many logs dont take up too much harddisk space. The ZIP file should be named after the duration of logs inside it, for example the day/week/month or year or a combination of them.
As an example, all the displayinfo/warning/errors will be logged. Also all the information as and when its updated in pragyanV3_log table in database should also be logged. Moreover, whenever any of us gets the time to go through the existing codes again, we may want to log all the MySQL errors which we display using die() function. Also extra log entries of what pragyan cms does internally can also be added, not only errors but also successful steps should be logged. Also if its possible to somehow pipe the PHP Warnings/ Notices and Errors one may get to see when config.inc.php errorlevel is set to 4, to the log file then it would greatly serve the purpose.
The log format should be
[TIME][DATE] : [FILENAME] : [LINENUMBER] : [ERRORTYPE] : [LOGINFO]
where TIME,DATE are as usual, FILENAME is the PHP file name where that log entry was generated, LINENUMBER is the line number in that file (it may not be possible to always get the LineNumber, put it only if you're able to find it), ERRORTYPE is the log type (error/warning/information), LOGINFO is the actual log entry.
The log class should have method that can be easily callable, something like
LOG::loginfo("quiz module creation done"). And similarly, LOG::logerror/logwarning, etc. NOTE that all functions are STATIC meaning user should not have to create an instance of LOG class to use its functions or other parameters. This is obvious because there will be a global LOG class for the entire CMS spanning all the files.
Also some ways should be found to detect the filename and linenumber without having the user to type it. However, if its really impossible to do that, the functions can be modified to look like this :
LOG::loginfo("cms/modules/quiz.lib.php","L:245","quiz module creation done")
But try hard to avoid it.
Note that this logging will be different that the existing log table in database. The existing log table only logs user actions, not pragyan cms internal activities.
The text was updated successfully, but these errors were encountered: