debug: move to hyprutils' logger (#12673)

This commit is contained in:
Vaxry 2025-12-18 17:23:24 +00:00 committed by GitHub
parent f88deb928a
commit 6175ecd4c4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
147 changed files with 1696 additions and 1709 deletions

View file

@ -12,7 +12,7 @@ static std::vector<std::pair<pid_t, WP<CAsyncDialogBox>>> asyncDialogBoxes;
//
SP<CAsyncDialogBox> CAsyncDialogBox::create(const std::string& title, const std::string& description, std::vector<std::string> buttons) {
if (!NFsUtils::executableExistsInPath("hyprland-dialog")) {
Debug::log(ERR, "CAsyncDialogBox: cannot create, no hyprland-dialog");
Log::logger->log(Log::ERR, "CAsyncDialogBox: cannot create, no hyprland-dialog");
return nullptr;
}
@ -63,7 +63,7 @@ void CAsyncDialogBox::onWrite(int fd, uint32_t mask) {
// TODO: can we avoid this without risking a blocking read()?
int fdFlags = fcntl(fd, F_GETFL, 0);
if (fcntl(fd, F_SETFL, fdFlags | O_NONBLOCK) < 0) {
Debug::log(ERR, "CAsyncDialogBox::onWrite: fcntl 1 failed!");
Log::logger->log(Log::ERR, "CAsyncDialogBox::onWrite: fcntl 1 failed!");
return;
}
@ -73,13 +73,13 @@ void CAsyncDialogBox::onWrite(int fd, uint32_t mask) {
// restore the flags (otherwise libwayland won't give us a hangup)
if (fcntl(fd, F_SETFL, fdFlags) < 0) {
Debug::log(ERR, "CAsyncDialogBox::onWrite: fcntl 2 failed!");
Log::logger->log(Log::ERR, "CAsyncDialogBox::onWrite: fcntl 2 failed!");
return;
}
}
if (mask & (WL_EVENT_HANGUP | WL_EVENT_ERROR)) {
Debug::log(LOG, "CAsyncDialogBox: dialog {:x} hung up, closed.");
Log::logger->log(Log::DEBUG, "CAsyncDialogBox: dialog {:x} hung up, closed.");
m_promiseResolver->resolve(m_stdout);
std::erase_if(asyncDialogBoxes, [this](const auto& e) { return e.first == m_dialogPid; });
@ -102,7 +102,7 @@ SP<CPromise<std::string>> CAsyncDialogBox::open() {
int outPipe[2];
if (pipe(outPipe)) {
Debug::log(ERR, "CAsyncDialogBox::open: failed to pipe()");
Log::logger->log(Log::ERR, "CAsyncDialogBox::open: failed to pipe()");
return nullptr;
}
@ -113,14 +113,14 @@ SP<CPromise<std::string>> CAsyncDialogBox::open() {
m_readEventSource = wl_event_loop_add_fd(g_pEventLoopManager->m_wayland.loop, m_pipeReadFd.get(), WL_EVENT_READABLE, ::onFdWrite, this);
if (!m_readEventSource) {
Debug::log(ERR, "CAsyncDialogBox::open: failed to add read fd to loop");
Log::logger->log(Log::ERR, "CAsyncDialogBox::open: failed to add read fd to loop");
return nullptr;
}
m_selfReference = m_selfWeakReference.lock();
if (!proc.runAsync()) {
Debug::log(ERR, "CAsyncDialogBox::open: failed to run async");
Log::logger->log(Log::ERR, "CAsyncDialogBox::open: failed to run async");
wl_event_source_remove(m_readEventSource);
return nullptr;
}