Logging improvements / despam

This commit is contained in:
Henrik Rydgård
2025-05-21 18:09:52 +02:00
parent 9cf5d1bc25
commit a36d3cf18d
6 changed files with 18 additions and 10 deletions
+7
View File
@@ -44,15 +44,22 @@ ScreenManager::~ScreenManager() {
void ScreenManager::switchScreen(Screen *screen) {
// TODO: inputLock_ ?
INFO_LOG(Log::UI, "ScreenManager::switchScreen('%s')", screen->tag());
if (!nextStack_.empty() && screen == nextStack_.front().screen) {
ERROR_LOG(Log::UI, "Already switching to this screen");
return;
}
// Note that if a dialog is found, this will be a silent background switch that
// will only become apparent if the dialog is closed. The previous screen will stick around
// until that switch.
// TODO: is this still true?
if (!nextStack_.empty()) {
for (int i = 0; i < nextStack_.size(); i++) {
INFO_LOG(Log::UI, "NextStack contents[%d].screen->tag(): '%s'", i, nextStack_[i].screen->tag());
}
ERROR_LOG(Log::UI, "Already had a nextStack_! Asynchronous open while doing something? Deleting the new screen.");
delete screen;
return;