diff --git a/servant/libservant/TarsNotify.cpp b/servant/libservant/TarsNotify.cpp index af452b7..fd58fe6 100644 --- a/servant/libservant/TarsNotify.cpp +++ b/servant/libservant/TarsNotify.cpp @@ -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); + } +} } diff --git a/servant/servant/TarsNotify.h b/servant/servant/TarsNotify.h index 8ce1811..c116f78 100644 --- a/servant/servant/TarsNotify.h +++ b/servant/servant/TarsNotify.h @@ -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: /**