Menu

#514 Info window for warning messages, etc.

None
open
nobody
None
5
2022-12-30
2022-12-23
No

Rosegarden currently spams stderr with dozens of lines of warning and information messages even during normal, error-free execution. These clutter the terminal when Rosegarden is run from the commandline (ls *.rg, rosegarden some_composition.rg, exit ... ls output is now scrolled off terminal screen), and go who-knows-where (eventually overflowing a buffer?) when Rosegarden is run from a "desktop environment" GUI.

Add a new --stderr (or some other name) commandline option. If not set, Rosegarden outputs nothing to stderr/stdout except fatal errors emitted immediately before an abort/error exit. Whether set or not, all text output goes to a new Qt text viewer widget/window, not displayed by default but viewable via a new "Info" icon/button in the main window added to the existing set of "Manage MIDI Devices", "Manage Synth Plugins", etc. If --stderr is set, text also goes to stderr/stdout as per current implementation.

Info viewer would be dismissed/"popped-down" via standard window manager UI and/or an explicit button, and would also implement a "Clear" button to erase already-viewed messages.

This user-visible feature would likely be implemented internally as modifications to the Debug.h classes and macros.

Discussion

  • Philip Leishman

    Philip Leishman - 2022-12-29

    Yes. See also the discussion about category logging (feature request 492).
    The RG_DEBUG logging uses QDebug(QtDebugMsg) which is enabled by default in debug builds. I believe it is disabled in the release version!
    A lot (but not all) of the debug output is suppressed with the RG_NO_DEBUG_PRINT macro.
    In my opinion (almost) all of the output is for developers and not users so I think an info window is not a good idea - it will just confuse users.
    The output (or at least most of it) can be suppressed with a qtlogging.ini file set using the QT_LOGGING_CONF environment variable:
    .debug=false
    .warning=false
    *.info=false

     
  • Mark R. Rubin

    Mark R. Rubin - 2022-12-30

    I agree that the solution lies in fixing RG's logging. The problems with that subsystem go all the way down to the fact that RG_WARNING (which should be, as per its name, for warnings) (regardless of how they might be output or not) is used throughout the code for debugging instead of RG_DEBUG or some similar, correctly-named macro/class/method/whatever.

    I disagree that (true) warnings shouldn't be accessible to users. Remember, I proposed that the info window would only be displayed on user command (button, menu, etc). For example, included in the verbose stderr text I get when running RG is the following:

    jack server is not running or cannot be started
    JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for -1, skipping unlock
    JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for -1, skipping unlock
    [JackDriver] initialise() - JACK server not running.  jackStatus: 11 (hex)
    [JackDriver]   Attempt to start JACK server was  NOT  made per user config
    

    The 2nd through 4th lines are the kind of debug-only output that I think we both agree doesn't belong in a release build, but I contend that the first and last lines are information that a user should be able to see when required. Just not by default, unavoidable, every time the program is run.

    Thanks for the tutorial on configuring Qt logging. I didn't have any luck with:

    $ export QT_LOGGING_CONF=`pwd`/qtlogging.ini
    $ cat > qtlogging.ini
    *.debug=false
    *.warning=false
    *.info=false
    

    The best results I got were from:

    export QT_LOGGING_RULES='*.debug=false;*.warning=false;*.info=false'
    

    (*=false isn't any better) but even that let through the low-level "jack" debug messages along with some others, plus some even more verbose spam:

    Debug output is disabled via Qt logging categories.
    Consequently, you will not see output from RG_WARNING and RG_DEBUG.
    Please check the following to re-enable logging:
      1. qtlogging.ini which may appear in several locations.
      2. The QT_LOGGING_CONF environment variable.
      3. The QT_LOGGING_RULES environment variable.
      4. The documentation for QLoggingCategory.
    QT_LOGGING_RULES overrides all others.  To enable all logging except qt:
      export QT_LOGGING_RULES="qt.*=false"
    

    For now I do rosegarden <file.rg> >& /dev/null which shuts up everything. But means that if something goes wrong I have to re-run without the stderr redirection to check for meaningful messages. Just like the "no warnings at all for the user" scheme, it's not a good solution.

     

Log in to post a comment.