I need to show a permanent "log" windows on top

Asked by juan

It happens to me very often, that I need to be able to see some global variables on the screen, to know how the sikuli script is working.
now I'm using Do.popup ("message \ n message", "title", 2)
but that has 2 problems: it stops me 2 seconds the execution of the script and then it closes when the script continues.
I have tried to create a file in which I save the variables that I want to show, and use a log viewer with autorefresh ... but it consumes resources, and it does not always work well.

the script controls an application that occupies part of the right half of the pc screen, so I have the entire left part of the screen to display information.

what is the optimal way to display that information?

Question information

Language:
English Edit question
Status:
Solved
For:
SikuliX Edit question
Assignee:
No assignee Edit question
Solved by:
RaiMan
Solved:
Last query:
Last reply:
Revision history for this message
masuo (masuo-ohara) said :
#1

I would connect another display.
And use primary screen for automation, use secondary screen for log viewer.

Usage with Multi Monitor Environments
https://sikulix-2014.readthedocs.io/en/latest/screen.html?highlight=SCREEN#multimonitorenvironments

Revision history for this message
juan (fogelmanjg) said :
#2

Thanks, but that's not what I'm looking for.
I know how to handle multiple monitors.
the problem is how to show the log at the same time that the script works

Revision history for this message
Ben Dix (bendix80) said :
#3

I am using the console output . works fine for me on win10.

for editing I start Sikuli using:
java -jar D:\pathToSikuli\sikulixide-2.0.5.jar -c

for running my script I use :
textstart java -jar D:\ pathToSikuli\sikulixide-2.0.5.jar -f D:\ pathToSikuli\LogFiles\SikuliLog.txt -r D:\ pathToSikuli\Start.sikuli

https://sikulix-2014.readthedocs.io/en/latest/faq/010-command-line.html#cmdoption-c-console

I simple arrange my output cmd and/or java window by using cmdow in commandline.
so every start, my windows get arranged as wanted.

maybe this helps.

greetings

Revision history for this message
Best RaiMan (raimund-hocke) said :
#4

Currently it is not possible to have this as a feature.

The best approach is, as already mentioned, to run from command line with option -c, so all messages are displayed in the command window.

In your script at appropriate places use the user log feature to print out what is needed.

Another option of course is to use Python subprocess to watch things in your script in parallel, which would allow, to do things based on elapsed time independently from what your script is doing (say: a snapshot of info every 5 seconds).
From here you could even show your own message window created with Java features.
From such a subprocess Do.popup would be the simplest way to show your info asynchronously without interrupting your main workflow.

Revision history for this message
juan (fogelmanjg) said (last edit ):
#5

Thanks RaiMan and Ben Dix, that solved my question.

Revision history for this message
TestMechanic (ndinev) said :
#6

Just my 2 cents: I created a splash screen that sit on top of the screen and I put there names of my tests or any debug info I want. Also it is valuable when I am analyzing my test results and watching video test log

Here is the sample of splashscreen: https://www.screencast.com/t/IB2iKLQ1wl