Does beta24 have a seperate script log?


#1

Does beta24 have a seperate script log ? because the default log get to much filled with other stuff i do not need. Just tried “#debug”; in entity script. but debugger seems not to trigger or open the debug window in high fidelity. if there’s any.

ALso feels like the devs only add more and more lines to the log. makes it only harder to find your print command back.

Not see any option to open debug window. And this test not doing anything.

"#debug";

    (function() 
    {
        // HiFi-specific way to enable "debug mode" for the script
        "#debug";

        // opens Qt Script Debugger paused as-if a breakpoint had been set
        debugger; 

        // `debugger` only affects debug mode (and is a no-op otherwise)
        //  you can use it anywhere JS statements can be used:

        // see: https://xkcd.com/221/
        this.clickDownOnEntity = function(entityID, mouseEvent) 
        {
            debugger;
            print("Click debug");
        }
        
    });    

Would be so nice to have everything about scripts.

  • Loading
  • Errors
  • print

To just have in seperate log !

Or that’s mabye more simpel.
just a filter so we can only display in the log screen the info we need.

Tried to write to the console. That’s failing to console.log , console.error only give… errors.

Another stopper in high fidelity. This days there’s to many spam in the log. The script editor is still complete not useable, fiont size and colors. and so far not found a betetr way to reroute all things that have todo with scripts to better cleaner window in high fidelity.


#2

(re: “#debug” – that only seems to work with Client scripts, not Entity scripts…)

Regarding log verbosity, I recommend setting up local Qt Logging Rules using a qtlogging.ini file or QT_LOGGING_RULES environment variable.

For example, to filter out everything except [hifi.scriptengine] messages – you could create a %LOCALAPPDATA%\QtProject\qtlogging.ini with the following:

[Rules]
*=false
hifi.scriptengine=true

Alternatively you could exclude just the categories getting in your way, for random example:

[Rules]
hifi.glLogging=false
hifi.*gpu*=false

In general qtlogging.ini can be placed in these platform-specific locations:

  • Windows: %LOCALAPPDATA%\QtProject\qtlogging.ini
  • OSX: ~/Library/Preferences/QtProject/qtlogging.ini
  • Linux: ~/.config/QtProject/qtlogging.ini

See http://doc.qt.io/qt-5/qloggingcategory.html#logging-rules for more info.

Note: on Linux I actually prefer using QT_LOGGING_RULES – launching Interface with something like:

$ env QT_LOGGING_RULES="*=false;*script*=true;" ./interface/interface --suppress-settings-reset

Below are the apparent categories for filtering log output against:

ps: on a per script basis it’s also possible to redirect print statements into say an Overlay/WebWindow – if interested in that approach, lemme know


#3

I’d like to know how to redirect print statements on a per script basis


#4

That would be not a bad idea. Because you can see the debug in HMD mode then. without swithcing between the vive desktop and Hifi. Would be nice if it can also show script reload or script errors. Then you have something like a script log almost :open_mouth:

Study on the QT settings meanwhile.

I think this works. as soon i found the right combination :open_mouth:
Anyway, tyhis example did not work. It made the logh very readable. Complete empty.

[Rules]
*=false
hifi.scripting=true

#5

Oops – typo on my part! That should have been hifi.scriptengine=true:

[Rules]
*=false
hifi.scriptengine=true

Edited my reply with the correction, but better yet might be to wildcard the rule as *script*=true (so that it catches any current and future script-related possibilities):

[Rules]
*=false
*script*=true