常见使用举例

配置初始化

\MessageNotify\AutoCatchException::init($youProjectId, $youCompanyKey);

切换配置

\MessageNotify\MessageNotify::singleInstance()->setKey($youCompanyKey)->setProjectId($youProjectId);

主动推送异常消息

\MessageNotify\MessageNotify::singleInstance()->exception($exception);

主动推送消息

$myMessageBody  =   new \MessageNotify\MessageBody();
$myMessageBody->setTitle('test');
\MessageNotify\MessageNotify::singleInstance()->addMessage($myMessageBody);

异常消息转为消息体

$myMessageBody  =   \MessageNotify\MessageNotify::exception2MessageBody($exception);
$myMessageBody->setTitle('异常消息');
\MessageNotify\MessageNotify::singleInstance()->addMessage($myMessageBody);

results matching ""

    No results matching ""