anametologin / krohnkite

A dynamic tiling extension for KWin
MIT License
316 stars 16 forks source link

No log entries after turning "Debug new Windows" option on #94

Open piotr-dobrogost opened 3 days ago

piotr-dobrogost commented 3 days ago

After following instructions in README's section Search a window parameters to filter, float etc. there are no entries in the log when filtering using krohnkite word in KSystemLog.

In the journal (after runningjournalctl) I noticed this which might be related:

paź 08 12:39:13 fedora kwin_wayland[43472]: qt.qml.usedbeforedeclared: file:///home/piotr/.local/share/kwin/scripts/krohnkite/contents/code/script.js:48:9 Variable "DEBUG" is used before its declaration at 3115:7.

Fedora 41 KWin 6.2.0 Krohnkite 8fec2e2

anametologin commented 2 days ago

Variable "DEBUG" is used before.... don't affect on Krohnkite work or debug. Try filters: qml and kwin you have to see qml: KROHNKITE: starting the script with debug or not.Try reboot system. Anyway it's not Krohnkite problem, if KSystemLog doesn't work properly, may be there is something else. You need journald log, unit: kwin-wayland.

piotr-dobrogost commented 2 days ago

I'm observing lack of log messages on two different systems, both with Fedora 41 and KWin 6.2. Can someone with KWin 6.2.0 check if it works or confirm it doesn't?

From Debug printing in Kwin scripts in r/kde Reddit (also posted in r/Fedora Reddit as KDE or Fedora issue? Print in Kwin Script not working.):

For some reason, console.info works! print, console.log and console.debug don't.

They mention QT_LOGGING_RULES="kwin_*.debug=true". Maybe it's not being set or set differently on Fedora and this is the reason for lack of log entries?

They give the following command to check the value of it for KWin process: cat /proc/$(pidof kwin_x11)/environ | tr -s '\0' '\n' | grep QT

I'm using Wayland not X11 and on my system it seems there's no QT_LOGGING_RULES set for KWin process:

$ sudo cat /proc/$(pidof kwin_wayland)/environ | tr -s '\0' '\n' | grep QT
QTDIR=/usr/lib64/qt-3.3
QTINC=/usr/lib64/qt-3.3/include
QTLIB=/usr/lib64/qt-3.3/lib
QT_AUTO_SCREEN_SCALE_FACTOR=0
QT_WAYLAND_RECONNECT=1

After finding Wayland and Plasmashell are spamming my syslog I run kdebugsettings and noticed that KWin Scripting log level is set to Warning:

kwin debug settings

I changed it to Full Debug hoping this would solve the problem but after logging out and back in nothing changed. Then I took a closer look at the notice at the top saying

A custom rule '*=true' is present, which may override more specific rules. It is better to remove it. :

custom debug false so I removed it and logged out and back in but it didn't help either.

phord commented 2 days ago

Try adding this custom rule, to unblock your original problem:

kwin_*.debug=true

I did not try logging out/in after making the changes to my kdebugsettings, but I definitely noticed they did not take effect immediately. They took effect after a restart. Maybe a logout/login is enough, but did you try restarting?

piotr-dobrogost commented 1 day ago

Try adding this custom rule, to unblock your original problem:

kwin_*.debug=true

I did not try logging out/in after making the changes to my kdebugsettings, but I definitely noticed they did not take effect immediately. They took effect after a restart. Maybe a logout/login is enough, but did you try restarting?

I tried kwin_*.debug=true and *.debug=true with restarting computer and neither helped.

piotr-dobrogost commented 1 day ago

I raised this issue at https://discuss.kde.org/t/debug-messages-from-kwin-script-using-console-log-not-present-in-the-journal-in-spite-of-setting-full-debug-in-kdebugsettings/23666 and https://bugs.kde.org/show_bug.cgi?id=494870