Skip to content

Commit

Permalink
Fix debug output
Browse files Browse the repository at this point in the history
  • Loading branch information
igor725 committed Jun 7, 2024
1 parent f444570 commit 6b2eb9c
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions input/log.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include <iostream>
#include "stdio.h"
#include <sstream>

#ifndef LOG_H
Expand All @@ -18,7 +18,14 @@ class Log {

~Log() {
debugLogStream << std::endl;
printf("%s", debugLogStream.str().c_str());

auto str = debugLogStream.str();

FILE *f = fopen("/dev/stdout", "w");
if (f != NULL) {
fwrite(str.c_str(), 1, str.size(), f);
fclose(f);
}

// Clear the stream
debugLogStream.str("");
Expand Down

0 comments on commit 6b2eb9c

Please sign in to comment.