forked from moonpower/azahar-UWP
Add instant log flush option (#209)
This commit is contained in:
@@ -68,7 +68,7 @@ public:
|
||||
}
|
||||
|
||||
void Flush() override {
|
||||
// stderr shouldn't be buffered
|
||||
std::fflush(stderr);
|
||||
}
|
||||
|
||||
void EnableForStacktrace() override {
|
||||
@@ -263,7 +263,14 @@ public:
|
||||
!boost::regex_search(FormatLogMessage(new_entry), regex_filter)) {
|
||||
return;
|
||||
}
|
||||
message_queue.EmplaceWait(new_entry);
|
||||
if (Settings::values.instant_debug_log.GetValue()) {
|
||||
ForEachBackend([&new_entry](Backend& backend) {
|
||||
backend.Write(new_entry);
|
||||
backend.Flush();
|
||||
});
|
||||
} else {
|
||||
message_queue.EmplaceWait(new_entry);
|
||||
}
|
||||
}
|
||||
|
||||
private:
|
||||
|
||||
@@ -147,6 +147,7 @@ void LogSettings() {
|
||||
log_setting("Debugging_DelayStartForLLEModules", values.delay_start_for_lle_modules.GetValue());
|
||||
log_setting("Debugging_UseGdbstub", values.use_gdbstub.GetValue());
|
||||
log_setting("Debugging_GdbstubPort", values.gdbstub_port.GetValue());
|
||||
log_setting("Debugging_InstantDebugLog", values.instant_debug_log.GetValue());
|
||||
}
|
||||
|
||||
bool IsConfiguringGlobal() {
|
||||
|
||||
@@ -542,6 +542,7 @@ struct Values {
|
||||
Setting<bool> delay_start_for_lle_modules{true, "delay_start_for_lle_modules"};
|
||||
Setting<bool> use_gdbstub{false, "use_gdbstub"};
|
||||
Setting<u16> gdbstub_port{24689, "gdbstub_port"};
|
||||
Setting<bool> instant_debug_log{false, "instant_debug_log"};
|
||||
|
||||
// Miscellaneous
|
||||
Setting<std::string> log_filter{"*:Info", "log_filter"};
|
||||
|
||||
Reference in New Issue
Block a user