[Kde-games-devel] Review Request 127708: KBreakout: Introduce Logging Categories

Julian Helfferich julian.helfferich at googlemail.com
Wed May 11 01:33:22 UTC 2016



> On April 27, 2016, 5:20 p.m., Frederik Schwarzer wrote:
> > src/kbreakout_debug.h, line 23
> > <https://git.reviewboard.kde.org/r/127708/diff/1/?file=456428#file456428line23>
> >
> >     Is there a reason to use the word "General" here? Since other games use "LOG". Not really in favor or against any of those but I think we should be consistent.
> 
> Julian Helfferich wrote:
>     Yes, there is: We might want to add further categories in the future such as KBREAKOUT_Graphics or KBREAKOUT_LevelLoader. I think LOG does not help to distinguish logging categories as they all log information of some kind. And having several different categories is the basic ideas of QLoggingCategories.
>     
>     In order of consistency, I would offer to change "LOG" to "General" for all games using it.
> 
> Frederik Schwarzer wrote:
>     Look what you did there. You made me read something and now I know more than I knew before. How dare you! :D
>     
>     OK, I never thought of QLoggingCategories that way. I did not know about qCCritical/Warning/Info. So far, I thought it was supposed to be used for different applications to make reading files like .xsession-errors actually possible again. But after reading the docs, it's clear that QLoggingCategories as two different purposes. On one hand there are the categories info, debug, warning and critical and on the other hand, there are "areas" where everyone can define custom "categories" that then work similarily.
>     
>     In that light, "General" does make much more sense than "LOG". I am in favour of changing all the games and would also offer my help. After all, it's just some sed/compile/commit action. :)
>     
>     But lets wait for some more opinions.

Honestly, I haven't thought about different applications writing to the same log file. I can see how logging categories make a great difference there. But even just for the output of a single application, I like the additional info which part of the program is writing the debug message. By the way, libkdegames already uses different categories, including "games.lib", "games.highscore", and "games.ui". I was also quite liberal in declaring logging categories in KBlocks.


- Julian


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://git.reviewboard.kde.org/r/127708/#review94926
-----------------------------------------------------------


On April 22, 2016, 10:55 a.m., Julian Helfferich wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://git.reviewboard.kde.org/r/127708/
> -----------------------------------------------------------
> 
> (Updated April 22, 2016, 10:55 a.m.)
> 
> 
> Review request for KDE Games.
> 
> 
> Repository: kbreakout
> 
> 
> Description
> -------
> 
> I am currently trying to track down some of the more intricate bugs of kbreakout, such as bug 354517, bug 328812, and bug 328811. To get to the root of the problem, a lot of debug output is necessary.
> 
> In the process, I learned about QLoggingCategories and added them to kbreakout. Generally, I looked at how other games use QLoggingCategories and copied the approach from Laurent Montel (KSnakeDuel, Grantier) and Frederik Schwarzer (KMahjongg). However, as I am no expert in Qt, I would appreciate your feedback.
> 
> 
> Diffs
> -----
> 
>   src/CMakeLists.txt eac51ff 
>   src/canvaswidget.cpp 1d80bfa 
>   src/gameengine.cpp 541f60c 
>   src/kbreakout_debug.h PRE-CREATION 
>   src/kbreakout_debug.cpp PRE-CREATION 
>   src/levelloader.cpp e609536 
> 
> Diff: https://git.reviewboard.kde.org/r/127708/diff/
> 
> 
> Testing
> -------
> 
> Compiled, played, confirmed that output is written to console.
> 
> 
> Thanks,
> 
> Julian Helfferich
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-games-devel/attachments/20160511/e13a58fd/attachment-0001.html>


More information about the kde-games-devel mailing list