Do not write debug information

Bug #1636626 reported by Pander
16
This bug affects 3 people
Affects Status Importance Assigned to Milestone
Mixxx
Fix Released
Wishlist
Sam

Bug Description

Please, do not write debug information. When running on the command line, a lot of debug information is printed. Print only warnings and errors please. Alternatively, offer a command line option -v to be more verbose and print these debug messages.

This was reported for mixxx version 2.0.0~dfsg-6.

Revision history for this message
Daniel Schürmann (daschuer) wrote :

What is your issue with the debug messages?
They where very helpful in the past to track down issues on user's machine.
I am afraid if they are disabled, we loose traces of faulty runs, that are hard to reproduce with debug messages enabled.

Revision history for this message
Pander (pander) wrote :

They pollute my command line. More common is to offer -v --verbose options to enable logging of different levels of debug (error, warning and info) messages.

Revision history for this message
RJ Skerry-Ryan (rryan) wrote :

On the other hand, Mixxx is a desktop application, not a command-line tool -- so the impact for most users of the debug output is pretty low while the usefulness of being able to direct someone to run it from a terminal to get debug info without any additional tweaking is high (most of our users are not technical so getting debug information for a bug can be very challenging).

Revision history for this message
Sam (vhexs) wrote :

Agreed, adding a verbose option that is disabled by default would just cause confusion and add work for no reason. It's good the way it is now. If you don't want to see debug messages you can always run from outside the console or just minimize the console window.

Revision history for this message
Pander (pander) wrote :

IMHO, this is not how most POSIX applications work, aimed for GUI or not. If most people don't run it in a terminal, then what is the point of writing this debug info in the first place? Adding a -v options is very common, even with different levels and it also speeds up the application. IF a user should investigate an erorr, he or she can be referred to usage of a -v option. See also `man firefox` for their verbose option.

Revision history for this message
Daniel Schürmann (daschuer) wrote :

I do not see it in firefox:

> -v, -version
> Print the current version of firefox.

"Make" has something like that:

--debug=v

I think it would be actually useful to remove the debug strings from the terminal output by default as long as they are still included in the mixxx.log. No one is able to read them that fast and the default terminal history is limited anyway so that important warnings are soon out of sight.

So if one thinks it is worth the time to implement it, go ahead.

Changed in mixxx:
status: New → Confirmed
importance: Undecided → Wishlist
Revision history for this message
RJ Skerry-Ryan (rryan) wrote :

I'd be for cutting down on the amount of debug info we print (we have a lot of speculative logging that might not be relevant anymore).

Revision history for this message
Pander (pander) wrote :

Yes, example firefox had an error, see for example `man gmpc`

       --debug-level=<level>
              Make GMPC output debug information

              0 - No output

              1 - Error Messages

              2 - Error and Warning Messages

              3 - All Messages

Revision history for this message
Sam (vhexs) wrote :

I'll give it a go. Haven't worked on anything like this before though, so bare with me.

Revision history for this message
Daniel Schürmann (daschuer) wrote :

What do you plan to do? Adding the
--debug-level=<level>
command line option
or removing spammy debug messages?

The command line args are parsed here:
https://github.com/mixxxdj/mixxx/blob/8d191bf7ce2d62d24c6e0ffac4b2afd7359afa8a/src/util/cmdlineargs.cpp#L25

The debug Messages are printed out here:
https://github.com/mixxxdj/mixxx/blob/8d191bf7ce2d62d24c6e0ffac4b2afd7359afa8a/src/util/logging.cpp#L92

Revision history for this message
Sam (vhexs) wrote :

Sorry for the late reply - I'm not sure yet. I'll look into ways I can implement it. A command line argument would probably be the best option, and there are definitely some debug messages that could be removed/set to a higher verbosity. Thanks for the links, I'll have a look at them shortly when this first build has completed (laptop is pretty slow so it'll take a while).

Revision history for this message
Sam (vhexs) wrote :

It's done, tested, and seems to be working! I've added a command line option "--debugLevel <int>" which will take a number between 0 and 2 (see below) and print to console only what's supposed to be on that debugging level. Some debug messages may need updating to fit the scheme, I'll get on that, but for now I've just gotta figure out how to make a patch/PR.

debugLevel options are as follows:
0 - Shows ONLY Critical and Fatal. These are always shown no matter what level is set
1 - Shows Critical, Fatal and Warning. This is the default option if --debugLevel is not set
2 - Shows the above with Debug messages. Recommended for debugging, but (hopefully) not required
If a non-integer value is given, a warning is displayed using fputs(..., stdout) and debugLevel defaults to 1. Negative values should theoretically mean debugLevel is set at 0 - Critical and Fatal don't bother checking the value of debugLevel.

I used the switch(type) statement inside logging.cpp. Messages are ALWAYS printed to the Logfile, no matter what debugLevel is set to.

I'll try to get a pull request up on GitHub tonight or tomorrow. If anything needs changing let me know and I'll do my best to sort it! :)

Revision history for this message
Pander (pander) wrote :

Thanks. Hope to test and use it in nightly after https://bugs.launchpad.net/mixxx/+bug/1636425 is fixed.

Revision history for this message
Sam (vhexs) wrote :

I made an error in my first commit, meaning the debugLevel variable was never checked, and I didn't test properly. My latest commit fixes it. Both are in the PR https://github.com/mixxxdj/mixxx/pull/1040 and it seems to be working as it should now.

Changed in mixxx:
status: Confirmed → In Progress
assignee: nobody → Sam (vhexs)
Changed in mixxx:
status: In Progress → Fix Committed
Changed in mixxx:
milestone: none → 2.1.0
Changed in mixxx:
status: Fix Committed → Fix Released
Revision history for this message
Swiftb0y (swiftb0y) wrote :

Mixxx now uses GitHub for bug tracking. This bug has been migrated to:
https://github.com/mixxxdj/mixxx/issues/8671

lock status: Metadata changes locked and limited to project staff
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.