Skip to main content

  | मौसम…

411 समाचार
Public archive edition · Attributed source reporting with original dates · AI drafts are excluded

411 REFERENCE · Wikibooks

Zoph/Solving Problems/Debug

Reference material by Wikibooks contributors. This retains its source identity and is not 411 news reporting.

In case something goes wrong and Zoph's normal error reporting does not give sufficient information to solve the problem, you can enable debugging. Debugging is controlled through 3 different options in config.inc.php: LOG_ALWAYS LOG_SEVERITY LOG_SUBJECT This will allow for granular debugging. This debugging mechanism will give you control over which messages are displayed and which not. Because the logging will be generated while Zoph is processing the page, debug messages will be displayed all over the page. This may sometimes cause Javascript, XML or Redirects to stop working, however, it will also make it easier to figure out where the problem occurred. Log Subjects Each logging message has been categorized in a subject: +Message subjectslog::ALLAll messageslog::VARSMessages regarding setting of variableslog::LANGMessages regarding the translation of Zophlog::LOGINMessages regarding the Login procedurelog::REDIRECTMessages regarding redirectionlog::DBMessages regarding the database connectionlog::SQLMessages regarding SQL Querieslog::XMLMessages regarding XML creationlog::IMGMessages regarding image creationlog::IMPORTMessages regarding the import functionslog::GENERALOther messageslog::NONENo messages. Log Severity and each message has gotten a severity indiction, that indicates how "bad" the situation is: +Severity indicationslog::DEBUGDebugging messages, Zoph gives information about what it's doing.log::NOTIFYNotification about something that is happening which is influencing Zoph's program flowlog::WARNWarning about something that is happeninglog::ERRORError condition, something has gone wrong, but Zoph can recoverlog::FATALFatal error, something has gone wrong and Zoph needs to stop execution of the current script.log::NONEDo not display any messages Configuration As mentioned before, 3 new configuration options have been added to config.inc.php. LOG_ALWAYS This setting configures a log level that is always displayed, no matter which subject the message is in. By default this is set to log::FATAL, which means that any message that has a severity of FATAL or worse is displayed. Since log::FATAL is the worst kind of message, only log::FATAL messages will be displayed. If you would set it to log::WARN, any message with a severity of WARN or worse will be displayed, hence any FATAL, ERROR or WARN message will be displayed. A special severity level has been added to suppress all messages: log::NONE Examples define('LOG_ALWAYS', log::ERROR); All messages which indicate an error or a fatal error will be displayed. define('LOG_ALWAYS', log::NOTIFY); All messages, except debug-level messages will be displayed. define('LOG_ALWAYS', log::DEBUG); All messages will be displayed. LOG_SEVERITY This setting works in the same way as the previous one, except that only messages for a specific severity will be displayed; it is used in combination with LOG_SUBJECT to achieve this. Examples define('LOG_SEVERITY', log::ERROR); define('LOG_SUBJECT', log::LANG); All messages which indicate an error or a fatal error, regarding the translation of Zoph will be displayed. define('LOG_SEVERITY', log::NOTIFY); define('LOG_SUBJECT', log::DB); All messages, except debug-level messages, regarding the database connection will be displayed. define('LOG_SEVERITY', log::DEBUG); define('LOG_SUBJECT', log::SQL); All messages regarding SQL-queries will be displayed. (since the SQL queries themselves are considered debug information, you will need this setting to show them.) LOG_SUBJECT With this setting you can control for which subjects you want to see the messages. There is a special subject to show all messages: log::ALL. You can also combine multiple subjects, using the | (or) sign and the ~ (not) sign. Examples define('LOG_SEVERITY', log::ERROR); define('LOG_SUBJECT', log::LANG | log::IMG); All messages which indicate an error or a fatal error, regarding the translation of Zoph or images will be displayed. define('LOG_SEVERITY', log::NOTIFY); define('LOG_SUBJECT', log::ALL | ~log::SQL); All messages, except debug-level messages, except those regarding SQL queries are displayed. define('LOG_SEVERITY', log::DEBUG); define('LOG_SUBJECT', log::ALL ~(log::REDIRECT | log::DB)); All messages except those regarding redirects or the database connection will be displayed.