TarsNotify.h add notify any app & server

This commit is contained in:
ruanshudong 2020-01-20 13:53:10 +08:00
parent c0ca4f3c92
commit f35ddf2b60
2 changed files with 26 additions and 29 deletions

View File

@ -101,34 +101,31 @@ 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);
// }
// }
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.sMessage = sMessage;
info.sNodeName = sNodeName;
_notifyPrx->async_reportNotifyInfo(NULL, info);
}
}
catch(exception &ex)
{
TLOGERROR("TarsRemoteNotify::notify error:" << ex.what() << endl);
}
catch(...)
{
TLOGERROR("TarsRemoteNotify::notify unknown error" << endl);
}
}
}

View File

@ -62,7 +62,7 @@ public:
* ,
* @param message
*/
// void report(const string &sMesage, const string & app, const string &serverName, const string &sNodeName);
void report(const string &sMesage, const string & app, const string &serverName, const string &sNodeName);
protected:
/**