mirror of
https://github.com/lkddi/nexusphp.git
synced 2026-04-24 12:07:23 +08:00
add write runing log func do_log()
This commit is contained in:
@@ -4401,4 +4401,23 @@ function dd($vars)
|
|||||||
echo '</pre>';
|
echo '</pre>';
|
||||||
exit(0);
|
exit(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function do_log($log)
|
||||||
|
{
|
||||||
|
global $TWEAK;
|
||||||
|
if (!empty($TWEAK['logging'])) {
|
||||||
|
$backtrace = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS, 2);
|
||||||
|
$content = sprintf(
|
||||||
|
"[%s] %s%s%s %s%s",
|
||||||
|
date('Y-m-d H:i:s'),
|
||||||
|
$backtrace[1]['class'] ?? '',
|
||||||
|
$backtrace[1]['type'] ?? '',
|
||||||
|
$backtrace[1]['function'] ?? '',
|
||||||
|
$log,
|
||||||
|
PHP_EOL
|
||||||
|
);
|
||||||
|
file_put_contents($TWEAK['logging'], $content, FILE_APPEND);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|||||||
Reference in New Issue
Block a user