1
0
mirror of https://github.com/OpenTTD/OpenTTD.git synced 2025-09-03 03:49:12 +00:00

Remove: Debug redirect over network

It does not work for dedicated servers because upon starting the process to
resolve the address to redirect to gets killed. Also with all the async going
on in the network code, the debug redirection will start very late in the
process.
This commit is contained in:
Rubidium
2024-01-14 21:07:35 +01:00
committed by rubidium42
parent a6873ef7dd
commit 564441e822
6 changed files with 0 additions and 55 deletions

View File

@@ -22,7 +22,6 @@
#include "3rdparty/fmt/chrono.h"
#include "network/network_admin.h"
SOCKET _debug_socket = INVALID_SOCKET;
#include "safeguards.h"
@@ -111,18 +110,6 @@ void DumpDebugFacilityNames(std::back_insert_iterator<std::string> &output_itera
*/
void DebugPrint(const char *level, const std::string &message)
{
if (_debug_socket != INVALID_SOCKET) {
std::string msg = fmt::format("{}dbg: [{}] {}\n", GetLogPrefix(), level, message);
/* Prevent sending a message concurrently, as that might cause interleaved messages. */
static std::mutex _debug_socket_mutex;
std::lock_guard<std::mutex> lock(_debug_socket_mutex);
/* Sending out an error when this fails would be nice, however... the error
* would have to be send over this failing socket which won't work. */
send(_debug_socket, msg.c_str(), (int)msg.size(), 0);
return;
}
if (strcmp(level, "desync") == 0) {
static FILE *f = FioFOpenFile("commands-out.log", "wb", AUTOSAVE_DIR);
if (f == nullptr) return;