There are some really handy debugging features which it's worth knowing about.
As Mahara ships, debug, info, warn an environ error messages are sent to your error log.
Environ message are also sent to screen.
The default settings for logging are in lib/config-defaults.php under the Logging Configuration section.
I tend to have my log levels set to LOG_TARGET_SCREEN | LOG_TARGET_ERRORLOG as below:
$cfg->log_dbg_targets = LOG_TARGET_SCREEN | LOG_TARGET_ERRORLOG; $cfg->log_info_targets = LOG_TARGET_SCREEN | LOG_TARGET_ERRORLOG; $cfg->log_warn_targets = LOG_TARGET_SCREEN | LOG_TARGET_ERRORLOG; $cfg->log_environ_targets = LOG_TARGET_SCREEN | LOG_TARGET_ERRORLOG;
You can then use the various log functions to log anything. Variables are printed in a sane format which is easy to read. It's really quite a breath of fresh air when you compare it to something as primitive as var_dump:
log_debug('hello'); log_info($object); log_warn($othervar); log_environ($yetanothervar);
As a result, it's often really helpful to tail the apache error log a lot of the time.