mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-07-06 23:11:25 +12:00
Don't log "always" messages in fatal_error_listener until enabled
Opening the console breaks Qt cli popups
This commit is contained in:
parent
3ecb14dcda
commit
431221f172
2 changed files with 28 additions and 6 deletions
|
@ -4790,7 +4790,7 @@ bool spu_thread::process_mfc_cmd()
|
||||||
getllar_spin_count = 0;
|
getllar_spin_count = 0;
|
||||||
getllar_busy_waiting_switch = umax;
|
getllar_busy_waiting_switch = umax;
|
||||||
|
|
||||||
u64 ntime;
|
u64 ntime = 0;
|
||||||
rsx::reservation_lock rsx_lock(addr, 128);
|
rsx::reservation_lock rsx_lock(addr, 128);
|
||||||
|
|
||||||
for (u64 i = 0; i != umax; [&]()
|
for (u64 i = 0; i != umax; [&]()
|
||||||
|
@ -4896,7 +4896,7 @@ bool spu_thread::process_mfc_cmd()
|
||||||
// Avoid logging useless commands if there is no reservation
|
// Avoid logging useless commands if there is no reservation
|
||||||
const bool dump = g_cfg.core.mfc_debug && raddr;
|
const bool dump = g_cfg.core.mfc_debug && raddr;
|
||||||
|
|
||||||
const bool is_spurs_task_wait = pc == 0x11e4 && spurs_addr != -0x80u;
|
const bool is_spurs_task_wait = pc == 0x11e4 && spurs_addr != 0u - 0x80u;
|
||||||
|
|
||||||
if (!is_spurs_task_wait || spurs_addr != raddr || spurs_waited)
|
if (!is_spurs_task_wait || spurs_addr != raddr || spurs_waited)
|
||||||
{
|
{
|
||||||
|
@ -5570,6 +5570,8 @@ s64 spu_thread::get_ch_value(u32 ch)
|
||||||
|
|
||||||
thread_ctrl::wait_on(state, old);
|
thread_ctrl::wait_on(state, old);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fmt::throw_exception("Unreachable"); // Fix unannotated fallthrough warning
|
||||||
}
|
}
|
||||||
|
|
||||||
case MFC_RdTagStat:
|
case MFC_RdTagStat:
|
||||||
|
|
|
@ -252,11 +252,12 @@ LOG_CHANNEL(q_debug, "QDEBUG");
|
||||||
|
|
||||||
struct fatal_error_listener final : logs::listener
|
struct fatal_error_listener final : logs::listener
|
||||||
{
|
{
|
||||||
|
public:
|
||||||
~fatal_error_listener() override = default;
|
~fatal_error_listener() override = default;
|
||||||
|
|
||||||
void log(u64 /*stamp*/, const logs::message& msg, const std::string& prefix, const std::string& text) override
|
void log(u64 /*stamp*/, const logs::message& msg, const std::string& prefix, const std::string& text) override
|
||||||
{
|
{
|
||||||
if (msg <= logs::level::fatal)
|
if (msg == logs::level::fatal || (msg == logs::level::always && m_log_always))
|
||||||
{
|
{
|
||||||
std::string _msg = "RPCS3: ";
|
std::string _msg = "RPCS3: ";
|
||||||
|
|
||||||
|
@ -276,10 +277,17 @@ struct fatal_error_listener final : logs::listener
|
||||||
_msg += '\n';
|
_msg += '\n';
|
||||||
|
|
||||||
// If launched from CMD
|
// If launched from CMD
|
||||||
utils::attach_console(utils::console_stream::std_err, false);
|
utils::attach_console(msg == logs::level::fatal ? utils::console_stream::std_err : utils::console_stream::std_out, false);
|
||||||
|
|
||||||
// Output to error stream as is
|
// Output to error stream as is
|
||||||
|
if (msg == logs::level::fatal)
|
||||||
|
{
|
||||||
utils::output_stderr(_msg);
|
utils::output_stderr(_msg);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
std::cout << _msg;
|
||||||
|
}
|
||||||
|
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
if (IsDebuggerPresent())
|
if (IsDebuggerPresent())
|
||||||
|
@ -295,6 +303,14 @@ struct fatal_error_listener final : logs::listener
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void log_always(bool enabled)
|
||||||
|
{
|
||||||
|
m_log_always = enabled;
|
||||||
|
}
|
||||||
|
|
||||||
|
private:
|
||||||
|
bool m_log_always = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
// Arguments that force a headless application (need to be checked in create_application)
|
// Arguments that force a headless application (need to be checked in create_application)
|
||||||
|
@ -572,7 +588,7 @@ int main(int argc, char** argv)
|
||||||
log_file = logs::make_file_listener(log_name, stats.avail_free / 4);
|
log_file = logs::make_file_listener(log_name, stats.avail_free / 4);
|
||||||
}
|
}
|
||||||
|
|
||||||
static std::unique_ptr<logs::listener> fatal_listener = std::make_unique<fatal_error_listener>();
|
static std::unique_ptr<fatal_error_listener> fatal_listener = std::make_unique<fatal_error_listener>();
|
||||||
logs::listener::add(fatal_listener.get());
|
logs::listener::add(fatal_listener.get());
|
||||||
|
|
||||||
{
|
{
|
||||||
|
@ -1000,6 +1016,10 @@ int main(int argc, char** argv)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Enable console output of "always" log messages.
|
||||||
|
// Do this after parsing any Qt cli args that might open a window.
|
||||||
|
fatal_listener->log_always(true);
|
||||||
|
|
||||||
// Log unique ID
|
// Log unique ID
|
||||||
gui::utils::log_uuid();
|
gui::utils::log_uuid();
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue