Coding standard for qdebug in libs

Jaroslaw Staniek staniek at kde.org
Tue Sep 8 20:42:29 BST 2015


On 8 September 2015 at 21:31, Friedrich W. H. Kossebau <kossebau at kde.org> wrote:
> Am Samstag, 5. September 2015, 12:55:28 schrieb Jaroslaw Staniek:
>> With increasing modularity it's quite important
>> for our debugging needs to have logging categories.
>
> Agreed.
>
>> A scheme could be like
>> {libnamelowercase}{Debug|Warning|Critical}()
>
> +1 for that scheme. Simply because that namespace-prefixing seems to match the
> usual namespace-prefixing as done with classes/files, don't see another reason
> for/against.
>
>> I also propose to use a libname prefix for the header name. This is
>> what many bits in KF5 do. So we won't have to deal with dozens files
>> prefixed with "Debug" soon (so libpigment's DebugPigment.h could
>> become PigmentDebug.h or pigment_debug.h).
>
> When I looked into debug porting for libs/ last week (still need to complete
> end of next week, so anyone wants to take over meanwhile? no code yet written
> here), I wondered if installed headers better should not include any debug-
> only headers at all.

*debug.h should not be installed. I see that KF5 does not install own headers.

> But with publix/exported templates which need/better have debug statements
> that might be unavoidable. Still not really sure though, it somehow seems
> dirty to me :)

Is there at least such a case in calligra.git? We can add a template
specialization and keep the implementation in .cpp.

Thanks for the review.

-- 
regards, Jaroslaw Staniek

KDE:
: A world-wide network of software engineers, artists, writers, translators
: and facilitators committed to Free Software development - http://kde.org
Calligra Suite:
: A graphic art and office suite - http://calligra.org
Kexi:
: A visual database apps builder - http://calligra.org/kexi
Qt Certified Specialist:
: http://www.linkedin.com/in/jstaniek



More information about the calligra-devel mailing list