mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-05-02 08:42:15 +09:00
Do not display meaningless debug information
This commit is contained in:
parent
12673a29c6
commit
e04efdd03e
3 changed files with 13 additions and 2 deletions
|
|
@ -101,6 +101,10 @@ class Debug
|
||||||
// Get the backtrace.
|
// Get the backtrace.
|
||||||
$backtrace_args = defined('\DEBUG_BACKTRACE_IGNORE_ARGS') ? \DEBUG_BACKTRACE_IGNORE_ARGS : 0;
|
$backtrace_args = defined('\DEBUG_BACKTRACE_IGNORE_ARGS') ? \DEBUG_BACKTRACE_IGNORE_ARGS : 0;
|
||||||
$backtrace = debug_backtrace($backtrace_args);
|
$backtrace = debug_backtrace($backtrace_args);
|
||||||
|
if (count($backtrace) > 1 && $backtrace[1]['function'] === 'debugPrint' && !$backtrace[1]['class'])
|
||||||
|
{
|
||||||
|
array_shift($backtrace);
|
||||||
|
}
|
||||||
|
|
||||||
// Create a log entry.
|
// Create a log entry.
|
||||||
$entry = (object)array(
|
$entry = (object)array(
|
||||||
|
|
|
||||||
|
|
@ -84,7 +84,9 @@ $(function() {
|
||||||
num = parseInt(i) + 1; if (num < 10) num = "0" + num;
|
num = parseInt(i) + 1; if (num < 10) num = "0" + num;
|
||||||
backtrace = "";
|
backtrace = "";
|
||||||
for (j in data.entries[i].backtrace) {
|
for (j in data.entries[i].backtrace) {
|
||||||
backtrace += "\n- " + data.entries[i].backtrace[j].file + ":" + data.entries[i].backtrace[j].line;
|
if (data.entries[i].backtrace[j].file) {
|
||||||
|
backtrace += "\n- " + data.entries[i].backtrace[j].file + ":" + data.entries[i].backtrace[j].line;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
entry.text(num + ". " + data.entries[i].message + backtrace);
|
entry.text(num + ". " + data.entries[i].message + backtrace);
|
||||||
}
|
}
|
||||||
|
|
@ -98,7 +100,9 @@ $(function() {
|
||||||
num = parseInt(i) + 1; if (num < 10) num = "0" + num;
|
num = parseInt(i) + 1; if (num < 10) num = "0" + num;
|
||||||
backtrace = "";
|
backtrace = "";
|
||||||
for (j in data.errors[i].backtrace) {
|
for (j in data.errors[i].backtrace) {
|
||||||
backtrace += "\n- " + data.errors[i].backtrace[j].file + ":" + data.errors[i].backtrace[j].line;
|
if (data.errors[i].backtrace[j].file) {
|
||||||
|
backtrace += "\n- " + data.errors[i].backtrace[j].file + ":" + data.errors[i].backtrace[j].line;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
entry.text(num + ". " + data.errors[i].type + ": " + data.errors[i].message + backtrace);
|
entry.text(num + ". " + data.errors[i].type + ": " + data.errors[i].message + backtrace);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -59,6 +59,9 @@ class documentItem extends Object
|
||||||
$this->columnList = $columnList;
|
$this->columnList = $columnList;
|
||||||
|
|
||||||
$this->_loadFromDB($load_extra_vars);
|
$this->_loadFromDB($load_extra_vars);
|
||||||
|
|
||||||
|
trigger_error("This is a test error message.", E_USER_WARNING);
|
||||||
|
debugPrint(array("This message was printed with debugPrint() function", "Array is okay"));
|
||||||
}
|
}
|
||||||
|
|
||||||
function setDocument($document_srl, $load_extra_vars = true)
|
function setDocument($document_srl, $load_extra_vars = true)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue