switch console output to tgbot logger

This commit is contained in:
Michael Mandl 2018-03-29 14:06:10 +02:00
parent 0489aa74e2
commit 912bcc3edb

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";