[genivi-dlt] DLT daemon log level usage?

Lipka, Christoph (ADITG/ESA) clipka at de.adit-jv.com
Fri May 19 02:48:21 EDT 2017


Hi,
 
> What does this implies since "This is a error" log log level is 
> already at DLT_LOG_ERROR? The meaning of DLT_LOG_VERBOSE is lost?
> I don't understand the use of dlt-control -l, sorry.
> 
> If we can already set a log level when using DLT_LOG, what is the 
> point of using dlt-control?
> I'm missing something I guess.

You can think about the current log level set in the library as a filter. 
E.g. if INFO is set in library and you have logs in your code:
DLT_LOG(INFO, ...)
DLT_LOG(ERROR,...)
DLT_LOG(VERBOSE,...)

The first two messages are forwarded to the daemon, the third message not. If you want to have VERBOSE messages also, you have to update the log level for the context to VERBOSE using the control application.
 
> Thanks again for the help!
> 
> 
> BTW the doc is nice, thanks, and:
> 
> $ cmake ../ -DWITH_DOC=ON
> [...]
> $ make -j8  2>&1 | grep FAILED
> [ 98%] [100%] asciidoc: FAILED: input file /home/obigo/opt/tmp/dlt- 
> daemon/README missing $ cd ../ & cp README.md README && cd build $ 
> make -j8 [ works fine ]

Oh interesting. That need to be fixed. If you like, you can provide a patch. I guess it is just a one line change in one script :-)
 
> On Fri, May 19, 2017 at 2:02 PM, Lipka, Christoph (ADITG/ESA) 
> <clipka at de.adit-jv.com> wrote:
> > Hi,
> >
> >> I'm new to DLT and the features are quite nice - thanks for 
> >> providing this to us!
> >
> > Good to hear this.
> >
> >> I have a question regarding log level setting in dlt daemon.
> >>
> >>
> >> I saw that the dlt-control program could accept the -l option to 
> >> set a given log level. I don't understand how this can be effectively used.
> >>
> >> From what I got reading the source code, it calls the function 
> >> "dlt_daemon_send_log_level" which calls 
> >> "dlt_daemon_user_send_log_level" and 
> >> "dlt_daemon_control_service_response".
> >> - the second is just to acknowledge dlt-control that the log level 
> >> has been set effectively.
> >> - the first one logs to FIFO (i.e to the application sending the 
> >> logs do the client, the application who called  DLT_REGISTER_APP)
> >> (src/daemon/dlt_daemon_common.c:1156)
> >>
> >> Is this correct?
> >>
> >> If I understood correctly, this means if we we want to use 
> >> dlt-control, we need to implement a response to 
> >> dlt_daemon_user_send_log_level (after calling DLT_REGISTER_APP) to 
> >> only send the right amount of log to dlt daemon afterward? Is there 
> >> any doc for this, could you point me out to some
> reference/function/source file please?
> >
> > After you registered your application id (e.g. "APP") and context id (e.g.
> "CON") in your application, you can use dlt-control application to 
> change the log level:
> > dlt-control -a APP -c CON -l 6 (for verbose level)
> >
> > There is no need to add any code inside your application, the log 
> > level is
> changed automatically. BTW: The initial log level is INFO. If you need 
> another log level directly on application start, you can use an 
> environment variable, e.g. export DLT_INITIAL_LOG_LEVEL=”APP:CON:6”
> >
> > If you want your application to execute specific functionality when 
> > log level
> is changed, you can register a callback function:
> > DLT_REGISTER_LOG_LEVEL_CHANGED_CALLBACK(CONTEXT, CALLBACK)
> >
> >> I couldn't find any doc/reference about it. Did I miss something?
> >
> > You can build documentation by adding "WITH_DOC=ON" when calling
> cmake, e.g. cmake .. -DWITH_DOC=ON. You may have to install some 
> dependent packages.
> >
> >  > Thanks for the help!
> >
> > Hope that helps.
> >
> > Best Regards,
> > Christoph
> >
> > _______________________________________________
> > genivi-diagnostic-log-and-trace mailing list 
> > genivi-diagnostic-log-and-trace at lists.genivi.org
> > http://lists.genivi.org/mailman/listinfo/genivi-diagnostic-log-and-trace


More information about the genivi-diagnostic-log-and-trace mailing list