Commit 26b47917 by Qiang Xue

Fixed a bug about enabling trace with profiling.

parent c3df0bee
...@@ -161,7 +161,7 @@ class Logger extends Component ...@@ -161,7 +161,7 @@ class Logger extends Component
public function log($message, $level, $category = 'application') public function log($message, $level, $category = 'application')
{ {
$time = microtime(true); $time = microtime(true);
if (YII_DEBUG && YII_TRACE_LEVEL > 0) { if (YII_DEBUG && YII_TRACE_LEVEL > 0 && !($level & self::LEVEL_PROFILE)) {
$traces = debug_backtrace(); $traces = debug_backtrace();
$count = 0; $count = 0;
foreach ($traces as $trace) { foreach ($traces as $trace) {
......
...@@ -184,7 +184,7 @@ abstract class Target extends Component ...@@ -184,7 +184,7 @@ abstract class Target extends Component
* @param array $except the message categories to exclude. If empty, it means all categories are allowed. * @param array $except the message categories to exclude. If empty, it means all categories are allowed.
* @return array the filtered messages. * @return array the filtered messages.
*/ */
public function filterMessages($messages, $levels = 0, $categories = array(), $except = array()) public static function filterMessages($messages, $levels = 0, $categories = array(), $except = array())
{ {
foreach ($messages as $i => $message) { foreach ($messages as $i => $message) {
if ($levels && !($levels & $message[1])) { if ($levels && !($levels & $message[1])) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment