php debug函数

2015-09-22 16:35  2554人阅读  评论 (0)
Tags: phpdebug

loginfo函数

function loginfo($format) {
    $args = func_get_args();
    array_shift($args);
    $d = debug_backtrace(DEBUG_BACKTRACE_PROVIDE_OBJECT, 1)[0];
    $info = vsprintf($format, $args);
    $data = sprintf("%s %s,%d: %s\n", date("Ymd His"), $d["file"], $d["line"], $info);
    file_put_contents(__DIR__."/log.txt", $data, FILE_APPEND);
}
豫ICP备09035262号-1