public static function log() { $log = CrayonLog::log(); touch(CRAYON_LOG_FILE); $exists = file_exists(CRAYON_LOG_FILE); $writable = is_writable(CRAYON_LOG_FILE); if (!empty($log)) { echo '<div id="crayon-log-wrapper">', '<div id="crayon-log"><div id="crayon-log-text">', $log, '</div></div>', '<div id="crayon-log-controls">', '<input type="button" id="crayon-log-toggle" show_txt="', crayon__('Show Log'), '" hide_txt="', crayon__('Hide Log'), '" class="button-secondary" value="', crayon__('Show Log'), '"> ', '<input type="submit" id="crayon-log-clear" name="', self::LOG_CLEAR, '" class="button-secondary" value="', crayon__('Clear Log'), '"> ', '<input type="submit" id="crayon-log-email" name="', self::LOG_EMAIL_ADMIN . '" class="button-secondary" value="', crayon__('Email Admin'), '"> ', '<input type="submit" id="crayon-log-email" name="', self::LOG_EMAIL_DEV, '" class="button-secondary" value="', crayon__('Email Developer'), '"> ', '</div>', '</div>'; } echo '<span', !empty($log) ? ' class="crayon-span"' : '', '>', empty($log) ? crayon__('The log is currently empty.') . ' ' : ''; if ($exists) { $writable ? crayon_e('The log file exists and is writable.') : crayon_e('The log file exists and is not writable.'); } else { crayon_e('The log file does not exist and is not writable.'); } echo '</span>'; }
function log($var) { if ($this->setting_val(CrayonSettings::ERROR_LOG)) { CrayonLog::log($var); } }