[Development] New Module Request: QtGeniviExtras

Thiago Macieira thiago.macieira at intel.com
Wed Aug 12 13:32:44 CEST 2015

On Wednesday 12 August 2015 09:55:14 Dominik Holland wrote:
> > But I can't give a +1 right now for the API you have of DLT. That looks
> > like something Qt should automatically be doing. Have you explored that
> > possibility? Can you explain why it shouldn't / couldn't be done like
> > that?
> In general you are right. It would be really nice if we could use
> QLoggingCategories straight away without any change, but the biggest
> problem is the way how DLT works.
> Every Process which wants to log using DLT needs to provide information
> about it's Application, this needs to be a 4 characters long unique
> identifier and a Description for it.

Sounds stupid...


Sorry, I dislike that API. One simple static function that you call in your 
main() function should be enough.

Moreover, it should be possible to derive that 4-char identifier from the 
application name passed to QCoreApplication::setApplicationName.

> Every LoggingCategory (In DLT it's called Context) needs to have a 3
> characters long unique identifier and a Description.

Stupid API limitation. Can you convince GENIVI to get rid of the 3-character 
identifier requirement? It should be an arbitrarily-long string, in which case 
we can use the logging category itself.

If that isn't possible, please derive the identifier from the category name.

In this case, DLT is nothing more than an extra logging backend for 
qlogging.cpp, like syslog (new in 5.6) and journald. I'd even accept this 
backend in QtCore itself.

By the way, doesn't GENIVI require systemd and thus journald anyway? Why do 
they have their own logging mechanism?

> I think the Description is not that hard to get (or not mandatory), but
> the 3 or 4 characters long identifiers are a blocker and nothing we can
> change as they are required by the DLT protocol. QLoggingCategories
> already have the categoryName which could act as a identifier, but the
> Developer would need to know that he is only allowed to use 3 characters
> here to make it usable by DLT. It also feels a bit awkward to use the
> enable it using the env variable:
> QT_LOGGING_RULES=inp.debug=true;gca.debug=false

qt_hash(the category name) then base64url-encode the result and cut to 3 

qt_hash("qt.qpa.windows") = 57960515
encoded → "gHd"

qt_hash("qt.widgets.gestures") = 115997699
encoded → "FWd"

Thiago Macieira - thiago.macieira (AT) intel.com
  Software Architect - Intel Open Source Technology Center

More information about the Development mailing list