Zoph/Solving Problems/Debug

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: 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_ALWAYS
 * LOG_SEVERITY
 * LOG_SUBJECT

Log Subjects
Each logging message has been categorized in a subject:

Log Severity
and each message has gotten a severity indiction, that indicates how "bad" the situation is:

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.