tars notify add notify message to app.server.nodename, web will show this message

This commit is contained in:
ruanshudong 2019-12-13 17:49:03 +08:00
parent 1e3bb68aaf
commit ac3a0d086f
2 changed files with 35 additions and 0 deletions

View File

@ -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);
}
}
}

View File

@ -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:
/**
*