Net Displayer. More...
#include <net_displayer.h>
Inherits NLMISC::IDisplayer.
Public Member Functions | |
| CNetDisplayer (bool autoConnect=true) | |
| Constructor. | |
| void | setLogServer (const CInetAddress &logServerAddr) |
| Sets logging server address. | |
| void | setLogServer (CCallbackClient *server) |
| Sets logging server with an already connected server. | |
| bool | connected () |
| Returns true if the displayer is connected to a Logging Service. | |
| virtual | ~CNetDisplayer () |
| Destructor. | |
Protected Member Functions | |
| virtual void | doDisplay (const NLMISC::CLog::TDisplayInfo &args, const char *message) |
| Sends the string to the logging server. | |
| void | findAndConnect () |
| Find the server (using the NS) and connect. | |
Private Attributes | |
| CInetAddress | _ServerAddr |
| CCallbackClient * | _Server |
| bool | _ServerAllocated |
Net Displayer.
Sends the strings to a logger server (LOGS). log_howto
Definition at line 43 of file net_displayer.h.
| NLNET::CNetDisplayer::CNetDisplayer | ( | bool | autoConnect = true |
) |
| NLNET::CNetDisplayer::~CNetDisplayer | ( | ) | [virtual] |
Destructor.
Definition at line 106 of file net_displayer.cpp.
References _Server, _ServerAllocated, and NLNET::CCallbackClient::disconnect().
| bool NLNET::CNetDisplayer::connected | ( | ) | [inline] |
Returns true if the displayer is connected to a Logging Service.
Definition at line 60 of file net_displayer.h.
References _Server, and NLNET::CCallbackClient::connected().
| void NLNET::CNetDisplayer::doDisplay | ( | const NLMISC::CLog::TDisplayInfo & | args, | |
| const char * | message | |||
| ) | [protected, virtual] |
Sends the string to the logging server.
Implements NLMISC::IDisplayer.
Definition at line 121 of file net_displayer.cpp.
References _Server, NLNET::CCallbackClient::connected(), NLMISC::CLog::TDisplayInfo::Date, NLMISC::IDisplayer::dateToHumanString(), NLMISC::CLog::TDisplayInfo::LogType, NLMISC::IDisplayer::logTypeToString(), NLNET::msg, NLMISC::CLog::TDisplayInfo::ProcessName, NLNET::CCallbackClient::send(), and NLMISC::CMemStream::serial().
| void NLNET::CNetDisplayer::findAndConnect | ( | ) | [protected] |
Find the server (using the NS) and connect.
Definition at line 56 of file net_displayer.cpp.
References _Server, _ServerAllocated, NLNET::CNamingClient::lookupAndConnect(), and nldebug.
Referenced by CNetDisplayer().
| void NLNET::CNetDisplayer::setLogServer | ( | CCallbackClient * | server | ) |
Sets logging server with an already connected server.
Definition at line 95 of file net_displayer.cpp.
References _Server, and NLNET::CCallbackClient::connected().
| void NLNET::CNetDisplayer::setLogServer | ( | const CInetAddress & | logServerAddr | ) |
Sets logging server address.
Call this method from outside only if you want to use a LOGS not registered within the NS. It does nothing if the displayer is already connected to a server.
Definition at line 73 of file net_displayer.cpp.
References _Server, _ServerAddr, _ServerAllocated, NLNET::CCallbackClient::connect(), and NLNET::CCallbackClient::connected().
CCallbackClient* NLNET::CNetDisplayer::_Server [private] |
Definition at line 79 of file net_displayer.h.
Referenced by connected(), doDisplay(), findAndConnect(), setLogServer(), and ~CNetDisplayer().
Definition at line 77 of file net_displayer.h.
Referenced by setLogServer().
bool NLNET::CNetDisplayer::_ServerAllocated [private] |
Definition at line 80 of file net_displayer.h.
Referenced by findAndConnect(), setLogServer(), and ~CNetDisplayer().
1.6.1