hypridle icon indicating copy to clipboard operation
hypridle copied to clipboard

Logs not visible when running with a non-tty output

Open Nemo157 opened this issue 1 year ago • 5 comments

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;

Nemo157 avatar Aug 04 '24 14:08 Nemo157

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

cjk avatar Aug 13 '24 10:08 cjk

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

vaxerski avatar Aug 13 '24 17:08 vaxerski

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

cjk avatar Aug 17 '24 15:08 cjk

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

Nemo157 avatar Aug 17 '24 21:08 Nemo157

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

cjk avatar Aug 18 '24 12:08 cjk

Fixed by #88

Nemo157 avatar Oct 25 '24 09:10 Nemo157