Skip to content

Commit

Permalink
Log when preparing for sleep/wakeup
Browse files Browse the repository at this point in the history
  • Loading branch information
rcaelers committed May 10, 2024
1 parent 88bd028 commit 67303e8
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions ui/app/toolkits/gtkmm/LoginSession.cc
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ LoginSession::init()
#if GLIBMM_CHECK_VERSION(2, 68, 0)
catch (std::exception &e)
{
std::cerr << e.what() << std::endl;
spdlog::warn(std::string("Failed to subscribe to events from Login manager") + std::string(e.what()));
}
#else
catch (const Glib::Exception &e)
Expand All @@ -79,13 +79,22 @@ LoginSession::on_signal(const Glib::ustring &sender, const Glib::ustring &signal
Glib::Variant<bool> start;
params.get_child(start);
auto core = context->get_core();
if (start.get())
{
spdlog::info("Prepare for sleep");
}
else
{
spdlog::info("Prepare for wakeup");
}

core->set_powersave(start.get());
}
}
#if GLIBMM_CHECK_VERSION(2, 68, 0)
catch (std::exception &e)
{
std::cerr << e.what() << std::endl;
spdlog::warn(std::string("Failed to process event from Login Manager:") + std::string(e.what()));
}
#else
catch (const Glib::Exception &e)
Expand Down

0 comments on commit 67303e8

Please sign in to comment.