hyprwm / hypridle

Hyprland's idle daemon
BSD 3-Clause "New" or "Revised" License
404 stars 25 forks source link

Logs not visible when running with a non-tty output #83

Closed Nemo157 closed 1 month ago

Nemo157 commented 3 months ago

When using the systemd service there are no logs visible, and similar can be simulated with hypridle | cat -.

My assumption is this is related to a lack of flushing in the debug helper, and when there's a tty connected there's implicit line-flushing enabled, but I'm not very familiar with how C++ stdout works. The following patch appears to fix the issue for me anyway:

diff --git a/src/helpers/Log.hpp b/src/helpers/Log.hpp
-        std::cout << std::vformat(fmt, std::make_format_args(args...)) << "\n";
+        std::cout << std::vformat(fmt, std::make_format_args(args...)) << std::endl;
cjk commented 3 months ago

Same here, no output whatsoever in user-journal after startup. I'd be in favor of merging the above simple fix.

vaxerski commented 3 months ago

I can't merge an issue ticket. It has to be made into a mr

cjk commented 3 months ago

@Nemo157 Care to provide a PR? I'd do it, since it looks simple enough, but I have zero C++ knowledge :cry:

Nemo157 commented 3 months ago

I'm also not familiar enough with the C++ stdlib to know if it is the correct fix.

cjk commented 3 months ago

Ah, too bad. Let's hope someone else finds this useful and picks it up.

Nemo157 commented 1 month ago

Fixed by #88