viennacl / viennaclbench-dev

A GUI for displaying benchmark results obtaind for operations in ViennaCL
Other
5 stars 3 forks source link

Eliminate terminal output #4

Closed karlrupp closed 9 years ago

karlrupp commented 10 years ago

Currently there is a lot of noise sent to the terminal. A GUI should not write anything to the terminal, since it is a GUI...

namikk commented 10 years ago

Fixed on Windows. https://github.com/viennacl/viennacl-benchmark-gui/commit/4f6d2ef523d783e9ea91a716bee59a691448160d Needs more testing before closing the issue.

karlrupp commented 10 years ago

Namik, I think you're tackling the issue from the wrong angle. The output should not just be sent to the nirvana, but instead the whole 'std::cout'-clutter should be removed from the source code. This will make the code easier to maintain, less cluttered, etc. :-)

namikk commented 10 years ago

I still need that output for debugging purposes. Sure I can remove a good deal of it, but also a good deal of it is very important to me. For now I'll just remove the large & unnecessary outputs.

karlrupp commented 10 years ago

To get most out of debugging facililties, I suggest to make a debugging flag available as a runtime parameter rather than a compile-time parameter. This way you can for example ask users to start the GUI with a debug flag and you'll get all the important information for 'remote debugging'. Otherwise we would have to provide separate debug builds, which is not great at all. How does this sound?

namikk commented 10 years ago

If it's a simple addition to the build system, sure. But I have to modify my code to adapt to that flag, then it'll have to wait. There are a lot more important things to focus on right now.

karlrupp commented 10 years ago

You'll certainly have to touch code. Debugging functionality is nothing one entirely defers to the build system...

namikk commented 10 years ago

It turns out it is possible to eliminate terminal output with just one build flag. Adding QT_NO_DEBUG_OUTPUT effectively silences all output generated with qDebug() function. This function is Qt's take on terminal output, and I have used it whenever I could. That means only std::cout output is going to be visible. To completely silence debug out, either all std::cout's need to be converted to qDebug(), or all std::cout outputs need to be enclosed within QT_NO_DEBUG_OUTPUT #ifdef statements. I converted a good deal of std::cout's to qDebug(), so it should be significantly more silent now.

karlrupp commented 10 years ago

That is still a static (compile-time) decision, isn't it? We can't expect users to compile the GUI in debug mode if something is broken, so I still opt for a runtime flag...

namikk commented 10 years ago

Using QT_NO_DEBUG_OUTPUT works for both debug and release modes. One just needs to remove it and the debug output will show up, even in release mode. Or are you perhaps referring to making a global variable that would control debug output dynamically and which users can modify to enable/disable output on-the-fly?

karlrupp commented 10 years ago

yes, I'm referring to a runtime flag to enable/disable the output. A global variable is one possible way to implement this, yes.