#include <ServerLogger.h>
Public Member Functions | |
| ServerLogger (unsigned interval=1, std::string directory="server_logs") | |
| Constructor. | |
| ~ServerLogger () | |
| Kills the thread and closes the output. | |
| void | saveLogs () |
| Saves logs to disk. | |
| void | operator() () |
| ServerLogger thread main body. | |
| void | logNewConnection (const std::string &ip, unsigned port) |
| EVENT LOGGING METHODS. | |
| void | logConnectionRemoved (const std::string &ip, unsigned port) |
| void | logWaitingForNewRequest () |
| long long | logRequestStart (std::vector< std::string > fields) |
| long long | logRequestStart (std::vector< std::string > fields, std::string object) |
| void | logRequestPerformed (long long id) |
| void | logReplySent (long long id) |
| void | logConnectionTimeout () |
| void | logSocketError () |
Definition at line 19 of file ServerLogger.h.
| ServerLogger::ServerLogger | ( | unsigned | interval = 1, |
|
| std::string | directory = "server_logs" | |||
| ) |
Constructor.
| interval | Time interval between saving logs to file. | |
| directory | Directory to save server logs. |
Definition at line 28 of file ServerLogger.cpp.
| void ServerLogger::operator() | ( | ) |
ServerLogger thread main body.
Saves logs in the infinite loop
Definition at line 21 of file ServerLogger.cpp.
| void ServerLogger::logNewConnection | ( | const std::string & | ip, | |
| unsigned | port | |||
| ) |
EVENT LOGGING METHODS.
For exapmle logNewConnection() logs incoming new connection.
All this methods are self-explanatory. In cases of confusion read the method name again ;)
Definition at line 111 of file ServerLogger.cpp.
| void ServerLogger::logConnectionRemoved | ( | const std::string & | ip, | |
| unsigned | port | |||
| ) |
| void ServerLogger::logWaitingForNewRequest | ( | ) |
| long long ServerLogger::logRequestStart | ( | std::vector< std::string > | fields | ) |
| long long ServerLogger::logRequestStart | ( | std::vector< std::string > | fields, | |
| std::string | object | |||
| ) |
| void ServerLogger::logRequestPerformed | ( | long long | id | ) |
| void ServerLogger::logReplySent | ( | long long | id | ) |
| void ServerLogger::logConnectionTimeout | ( | ) |
| void ServerLogger::logSocketError | ( | ) |
1.5.5