sys_tty: Reduce thread dump log spam

Some games just log random errors.
This commit is contained in:
Elad Ashkenazi 2024-05-20 21:38:56 +03:00
parent 89299eb1f7
commit 164c3fa9cb
1 changed files with 3 additions and 3 deletions

View File

@ -128,14 +128,14 @@ error_code sys_tty_write([[maybe_unused]] ppu_thread& ppu, s32 ch, vm::cptr<char
sample = {}; // Remove reference to string sample = {}; // Remove reference to string
if (msg.size() >= 2u && ([&]() if (msg.size() >= 2u && [&]()
{ {
static thread_local u64 last_write = 0; static thread_local u64 last_write = 0;
// Dump thread about every period which TTY was not being touched for about half a second // Dump thread about every period which TTY was not being touched for about half a second
const u64 current = get_system_time(); const u64 current = get_system_time();
return current - std::exchange(last_write, current) >= 3'000'000; return current - std::exchange(last_write, current) >= (warning ? 500'000 : 3'000'000);
}() || warning)) }())
{ {
ppu_log.notice("\n%s", dump_useful_thread_info()); ppu_log.notice("\n%s", dump_useful_thread_info());
} }