Skip to content

Commit

Permalink
refactor: add more debug
Browse files Browse the repository at this point in the history
  • Loading branch information
Disservin committed Feb 5, 2025
1 parent 563a141 commit e9fba33
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
1 change: 1 addition & 0 deletions app/src/core/globals/globals.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ void writeToOpenPipes() {
process_list.lock();

for (const auto &process : process_list) {
Logger::trace("Writing to process with pid/handle: {}", process.identifier);
#ifdef _WIN64
[[maybe_unused]] DWORD bytes_written;
WriteFile(process.fd_write, &nullbyte, 1, &bytes_written, nullptr);
Expand Down
5 changes: 4 additions & 1 deletion app/src/engine/process/process_win.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,10 @@ class Process : public IProcess {
constexpr static int buffer_size = 4096;

public:
~Process() override { terminate(); }
~Process() override {
Logger::trace<true>("Process destructor called for {} with pid {}", log_name_, pi_.dwProcessId);
terminate();
}

Status init(const std::string &dir, const std::string &path, const std::string &args,
const std::string &log_name) override {
Expand Down
4 changes: 3 additions & 1 deletion app/src/matchmaking/tournament/base/tournament.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,9 @@ int BaseTournament::getMaxAffinity(const std::vector<EngineConfiguration> &confi

void BaseTournament::restartEngine(std::unique_ptr<engine::UciEngine> &engine) {
Logger::trace<true>("Restarting engine {}", engine->getConfig().name);
engine = std::make_unique<engine::UciEngine>(engine->getConfig(), engine->isRealtimeLogging());
auto config = engine->getConfig();
auto rl = engine->isRealtimeLogging();
engine = std::make_unique<engine::UciEngine>(config, rl);
}

std::size_t BaseTournament::setResults(const stats_map &results) {
Expand Down

0 comments on commit e9fba33

Please sign in to comment.