mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2025-05-31 15:53:17 +00:00
made an option for logging to be synced by default instead of async
This commit is contained in:
parent
02dcf4d45c
commit
8c4f386641
3 changed files with 32 additions and 9 deletions
|
@ -175,15 +175,30 @@ public:
|
|||
using std::chrono::microseconds;
|
||||
using std::chrono::steady_clock;
|
||||
|
||||
message_queue.EmplaceWait(Entry{
|
||||
.timestamp = duration_cast<microseconds>(steady_clock::now() - time_origin),
|
||||
.log_class = log_class,
|
||||
.log_level = log_level,
|
||||
.filename = filename,
|
||||
.line_num = line_num,
|
||||
.function = function,
|
||||
.message = std::move(message),
|
||||
});
|
||||
if (Config::getLogType() == "async") {
|
||||
|
||||
message_queue.EmplaceWait(Entry{
|
||||
.timestamp = duration_cast<microseconds>(steady_clock::now() - time_origin),
|
||||
.log_class = log_class,
|
||||
.log_level = log_level,
|
||||
.filename = filename,
|
||||
.line_num = line_num,
|
||||
.function = function,
|
||||
.message = std::move(message),
|
||||
});
|
||||
} else {
|
||||
|
||||
const Entry entry = {
|
||||
.timestamp = duration_cast<microseconds>(steady_clock::now() - time_origin),
|
||||
.log_class = log_class,
|
||||
.log_level = log_level,
|
||||
.filename = filename,
|
||||
.line_num = line_num,
|
||||
.function = function,
|
||||
.message = std::move(message),
|
||||
};
|
||||
ForEachBackend([&entry](auto& backend) { backend.Write(entry); });
|
||||
}
|
||||
}
|
||||
|
||||
private:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue