switch console output to tgbot logger

master
Michael Mandl 2018-03-29 14:06:10 +02:00
parent 0489aa74e2
commit 912bcc3edb
1 changed files with 4 additions and 2 deletions

View File

@ -16,9 +16,11 @@ void MessageHandler::handle(const tgbot::types::Message &message, const tgbot::m
return; return;
} }
std::cout << message.from->firstName std::ostringstream logMessage;
logMessage << message.from->firstName
<< " (" << *message.from->username << "): " << " (" << *message.from->username << "): "
<< (message.text != nullptr ? *message.text : "<no text>") << std::endl; << (message.text != nullptr ? *message.text : "<no text>");
api.getLogger().info(logMessage.str());
std::ostringstream reply; std::ostringstream reply;
reply << "You said"; reply << "You said";