Skip to content
This repository was archived by the owner on Feb 7, 2026. It is now read-only.

Commit 178cf44

Browse files
committed
fixed logger log writting
1 parent 6b6f666 commit 178cf44

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/Logger/Logger.hpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,11 +138,14 @@ class Logger {
138138
} else {
139139
logToStream (std::cout, level, message, caller, now_tm);
140140
}
141+
141142
// Výstup do souboru, pokud je povolen
142143
if (logFile_.is_open ()) {
143144
logFile_ << "[" << std::put_time (&now_tm, "%d-%m-%Y %H:%M:%S") << "] ";
144145
logFile_ << "[" << (caller.empty () ? "empty caller" : caller) << "] ";
145146
logFile_ << "[" << levelToString (level) << "] " << message << "\n";
147+
148+
logFile_.flush (); // Flush the log file to ensure all messages are written
146149
}
147150
}
148151

@@ -278,7 +281,7 @@ class Logger {
278281
if (addNewLine_) {
279282
stream << "\n";
280283
}
281-
284+
282285
// Explicitně flushovat buffer pro okamžitý výstup
283286
stream.flush ();
284287
}

0 commit comments

Comments
 (0)