зеркало из https://github.com/mozilla/Negatus.git
log received command lines
This commit is contained in:
Родитель
163c8f3878
Коммит
0de76baf69
|
@ -4,6 +4,7 @@
|
|||
* You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
#include "CommandEventHandler.h"
|
||||
#include "Hash.h"
|
||||
#include "Logger.h"
|
||||
#include "Logging.h"
|
||||
#include "PullFileEventHandler.h"
|
||||
#include "PushFileEventHandler.h"
|
||||
|
@ -143,6 +144,7 @@ CommandEventHandler::handleEvent(PRPollDesc desc)
|
|||
void
|
||||
CommandEventHandler::handleLine(std::string line)
|
||||
{
|
||||
Logger::instance()->log("Recvd line: " + line);
|
||||
CommandLine cl(line);
|
||||
if (cl.cmd.empty())
|
||||
return;
|
||||
|
|
|
@ -22,3 +22,8 @@ Logger::instance()
|
|||
mInstance = new Logger();
|
||||
return mInstance;
|
||||
}
|
||||
|
||||
void
|
||||
Logger::log(std::string msg) {
|
||||
PR_LOG(logModule, PR_LOG_ALWAYS, (msg.c_str()));
|
||||
}
|
||||
|
|
|
@ -7,9 +7,12 @@
|
|||
|
||||
#include <prlog.h>
|
||||
|
||||
#include <string>
|
||||
|
||||
class Logger {
|
||||
public:
|
||||
static Logger* instance();
|
||||
void log(std::string msg);
|
||||
|
||||
private:
|
||||
static Logger* mInstance;
|
||||
|
|
Загрузка…
Ссылка в новой задаче