mirror of
https://gitee.com/TarsCloud/TarsCpp.git
synced 2024-12-22 22:16:38 +08:00
tars notify add notify message to app.server.nodename, web will show this message
This commit is contained in:
parent
1e3bb68aaf
commit
ac3a0d086f
@ -99,6 +99,35 @@ void TarsRemoteNotify::notify(NOTIFYLEVEL level, const string &sMessage)
|
||||
}
|
||||
}
|
||||
|
||||
void TarsRemoteNotify::report(const string &sMessage, const string & app, const string &serverName, const string &sNodeName)
|
||||
{
|
||||
try
|
||||
{
|
||||
if(_notifyPrx)
|
||||
{
|
||||
ReportInfo info;
|
||||
// info.eType = 0;
|
||||
info.sApp = app;
|
||||
info.sServer = serverName;
|
||||
info.sSet = "";
|
||||
info.sThreadId = "";//TC_Common::tostr(pthread_self());
|
||||
info.sMessage = sMessage;
|
||||
info.sNodeName = sNodeName;
|
||||
// info.eLevel = level;
|
||||
//_notifyPrx->async_notifyServer(NULL, _app + "." + _serverName, level, sMessage);
|
||||
_notifyPrx->async_reportNotifyInfo(NULL, info);
|
||||
}
|
||||
}
|
||||
catch(exception &ex)
|
||||
{
|
||||
TLOGERROR("TarsRemoteNotify::notify error:" << ex.what() << endl);
|
||||
}
|
||||
catch(...)
|
||||
{
|
||||
TLOGERROR("TarsRemoteNotify::notify unknown error" << endl);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
@ -58,6 +58,12 @@ public:
|
||||
*/
|
||||
void report(const string &sResult, bool bSync = false);
|
||||
|
||||
/**
|
||||
* 指定通知到某个服务, 一定是异步上报的
|
||||
* @param message
|
||||
*/
|
||||
void report(const string &sMesage, const string & app, const string &serverName, const string &sNodeName);
|
||||
|
||||
protected:
|
||||
/**
|
||||
* 通信器
|
||||
|
Loading…
Reference in New Issue
Block a user