Commit c35d2b2c by 王召彬

fixbug:协程方式记腾讯云日志

parent e3277fdf
...@@ -58,9 +58,21 @@ class LogHandler extends AbstractProcessingHandler ...@@ -58,9 +58,21 @@ class LogHandler extends AbstractProcessingHandler
$messageText = implode(" __||__ ", $records); $messageText = implode(" __||__ ", $records);
if($this->topicId == ClsLog::TOPICID_ERROR) { if($this->topicId == ClsLog::TOPICID_ERROR) {
if (App::isCoContext()) {
go(function () use ($messageText) {
ClsLog::error($messageText); ClsLog::error($messageText);
});
} else {
ClsLog::error($messageText);
}
} else if($this->topicId == ClsLog::TOPICID_NOTICE) { } else if($this->topicId == ClsLog::TOPICID_NOTICE) {
if (App::isCoContext()) {
go(function () use ($messageText) {
ClsLog::notice($messageText); ClsLog::notice($messageText);
});
} else {
ClsLog::notice($messageText);
}
} }
} }
......
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