https://bugs.kde.org/show_bug.cgi?id=463967

            Bug ID: 463967
           Summary: Missing console.log when running Plasmoid Launcher
    Classification: Applications
           Product: kdevelop
           Version: 5.10.221200
          Platform: Other
                OS: Linux
            Status: REPORTED
          Severity: normal
          Priority: NOR
         Component: Output Views
          Assignee: kdevelop-bugs-n...@kde.org
          Reporter: ash...@linuxcomp.ru
  Target Milestone: ---

SUMMARY
When executing plasmoid, there is no output from console.log messages from
plasmoid.

I am developing the plasmoid/widget using KDevelop. I want to be able to launch
it for testing with Execute button. For this I created a new launch
configuration of type Plasmoid Launcher. But it misses the debugging/log
messages.


STEPS TO REPRODUCE
1. Open a plasmoid project that has some console.log messages in it. I use my
own org.kde.plasma.monitorcommander.
2. Create a launch configuration:
2.1 Click Run -> "Configure Launches". A Launch Configurations window will
appear.
2.2 Press Add -> "Plasmoid Launcher".
2.3. In the "Path or name" type the name or path of the plasmoid
(org.kde.plasma.monitorcommander).
2.4 Apply and OK.
3. Press Execute button
4. In Plasmoidviewer window trigger some thing in the plasmoid that should
output something with console.log

OBSERVED RESULT
In the "Run" tool view there is no any logs from plasmoid. The only output is:
```
/tmp> /usr/bin/plasmoidviewer --formfactor planar -a
org.kde.plasma.monitorcommander
QML debugging is enabled. Only use this in a safe environment.
```

EXPECTED RESULT
There should be output that plasmoid generates. Like
```
QML debugging is enabled. Only use this in a safe environment.
qml: View QML loaded
qml: Hello World <-- the thing plasmoid spitted with console.log
```

SOFTWARE/OS VERSIONS
Operating System: Arch Linux
KDE Plasma Version: 5.26.5
KDE Frameworks Version: 5.101.0
Qt Version: 5.15.7
KDevelop: 5.10.221200 (22.12.0)

ADDITIONAL INFORMATION
I was able to workaround this.

Workaround 1: Use script configuration and set special environment variable
1. Create a script plasmoid_viewer.sh with the following content:
```
#!/bin/bash

echo heelloo
plasmoidviewer -a org.kde.plasma.monitorcommander
```
2. In the "Launch Configurations" add new Script Application. Set "Script
interpreter" to bash, set "Always run the same file" and enter the path to the
plasmoid_viewer.sh
3. In "Environment" create a new profile, and add the variable
QT_FORCE_STDERR_LOGGING with value "1".
4. Choose Run -> "Current Run Configuration" and select a script application
you just created.
5. Press Execute.
Now you see the console.log messages from plasmoid.

P.S. The idea was taken from Bug 397062, and the QT_LOGGING_TO_CONSOLE is
deprecated, it was said (not sure if I choose the correct one, but it worked):
warning: Environment variable QT_LOGGING_TO_CONSOLE is deprecated, use
QT_ASSUME_STDERR_HAS_CONSOLE and/or QT_FORCE_STDERR_LOGGING instead.
Without setting a variable, the script's "heelloo" is shown, but plasmoid's log
is still not shown. So variable is needed.

Workaround 2. Create External Script that launches Konsole and use it instead
of Execute button and Run tool view.
1. In "External Scripts" tool view create a new command:
```
konsole -e "plasmoidviewer -a org.kde.plasma.monitorcommander"
```
2. Press that new script entry.
Now you can see the all output including console.log in a separate konsole
window.

See also: Bug 397062, Bug 360093

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to