Disable logging on the Wine side

It was incredibly verbose, and for debugging the networking part you
could still use stdout.
This commit is contained in:
Robbert van der Helm
2020-03-07 23:36:30 +01:00
parent 35b0174b9e
commit 3bfb6cf38b
5 changed files with 44 additions and 72 deletions
+10 -5
View File
@@ -6,20 +6,25 @@ intptr_t send_event(boost::asio::local::stream_protocol::socket& socket,
intptr_t value,
void* data,
float option,
Logger& logger,
bool is_dispatch) {
std::optional<std::pair<Logger&, bool>> logging) {
auto payload =
data == nullptr
? std::nullopt
: std::make_optional(std::string(static_cast<char*>(data)));
logger.log_event(is_dispatch, opcode, index, value, payload, option);
if (logging.has_value()) {
auto [logger, is_dispatch] = *logging;
logger.log_event(is_dispatch, opcode, index, value, payload, option);
}
const Event event{opcode, index, value, option, payload};
write_object(socket, event);
const auto response = read_object<EventResult>(socket);
logger.log_event_response(is_dispatch, response.return_value,
response.data);
if (logging.has_value()) {
auto [logger, is_dispatch] = *logging;
logger.log_event_response(is_dispatch, response.return_value,
response.data);
}
if (response.data.has_value()) {
char* char_data = static_cast<char*>(data);