[Development] Categorized logging inside Qt

Jędrzej Nowacki jedrzej.nowacki at digia.com
Fri Apr 11 13:07:42 CEST 2014


On Friday 11 of April 2014 08:31:41 Rutledge Shawn wrote:
> On 11 Apr 2014, at 10:11 AM, Poenitz Andre wrote:
> > Shawn.Rutledge at digia.com wrote:
> >> On 10 Apr 2014, at 7:20 PM, Frederik Gladhorn wrote:
> >>> Hi all,
> >>> 
> >>> I just started to port accessibility to the new and shiny categorized
> >>> logging.
> >>> http://blog.qt.digia.com/blog/2014/03/11/qt-weekly-1-categorized-loggin
> >>> g/
> >>> 
> >>> I'd propose we decide on a certain style of declaring categories.
> >>> 
> >>> A quick grep shows that we already have some variety, I'd like to unify
> >>> this before Qt 5.3 is out of the door. I actually saw a patch adding
> >>> DBG_FOOBAR as new category, that made me wonder about which style we
> >>> should use.>> 
> >> I think the pattern is OK though: all uppercase, with a prefix like DBG
> >> and try to keep them as short as possible since they get repeated all
> >> over.
> > 
> > We tend to avoid abbreviations, so DBG instead of DEBUG looks odd.
> > 
> > Your reasoning that it's REPEATED ALL OVER also MAKES ME THINK
> > that USING ALL CAPS might be NO GOOD IDEA as it gives ME the
> > feeling the code is constantly SHOUTING AT ME.
> 
> Not having all caps would be fine, but I still think they should be short,
> and don't see a problem with abbreviations because the context is obvious;
> it doesn't obscure the meaning like making a member variable or function
> name too short would do.  qCDebug is already an abbreviation for "Qt
> categorized logging of the debug variety".
> _______________________________________________
> Development mailing list
> Development at qt-project.org
> http://lists.qt-project.org/mailman/listinfo/development

Hi,

  So 'C' in qCDebug is for "categorized", I thought that it is for "C-like". 
Abbreviations in code are wrong, please try to avoid them. Meaning is obvious 
for you, because you already knew the meaning, for a newcomer it is not that 
trivial.

Cheers,
  Jędrek



More information about the Development mailing list