diff --git a/library/think/Hook.php b/library/think/Hook.php index 0ac83e85..8e6b846c 100644 --- a/library/think/Hook.php +++ b/library/think/Hook.php @@ -101,7 +101,12 @@ class Hook if (APP_DEBUG) { Debug::remark('behavior_end', 'time'); - Log::record('[ BEHAVIOR ] Run ' . ($name instanceof \Closure ? 'Closure' : $name) . ' @' . $tag . ' [ RunTime:' . Debug::getRangeTime('behavior_start', 'behavior_end') . 's ]', 'info'); + if ($name instanceof \Closure) { + $name = 'Closure'; + } elseif (is_object($name)) { + $name = get_class($name); + } + Log::record('[ BEHAVIOR ] Run ' . $name . ' @' . $tag . ' [ RunTime:' . Debug::getRangeTime('behavior_start', 'behavior_end') . 's ]', 'info'); } if (false === $result) { // 如果返回false 则中断行为执行