kDebug and the Application object

Michael Jansen kde at michael-jansen.biz
Sun Apr 13 18:36:43 BST 2008


On Sunday 13 April 2008 18:03:41 Thiago Macieira wrote:
> Michael Jansen wrote:
> >i get
> >
> ><unknown program name>(11138)/ main: Application starts
> >testcase(11138) main: Application starts
> >
> >So kDebug learns the application name sometime during the creation of
> > the application object.
>
> Technically, it's during the creation of the main KComponentData.
>
> > That behavior is not documented for kDebug()
> > and friends. I think it should be if that is indeed the correct
> > behavior.
>
> Why? We don't document we print the PID, application name or function name
> at all. In fact, we don't have to. It can be anything. It depends on the
> backend.
>
> >I stumbled upon that with an KUniqueApplication doing some checks before
> >starting the application and giving some info's to the user.
>
> Well, as long as it isn't using kDebug for that. kDebug is for debugging
> info, not to give some information to the user.
>

I said kDebug and friends. I should have emphasized(?) that more. 

Remember there are kError and kWarning too. Both have the same problem. And i 
would expect to get a application name when seeing an error message. <unknown 
program name> is definetely not correct there.

Back to printf seems to be wrong for me. Is it safe to set the mainComponent 
before creating the application object?

Mike


-- 
Michael Jansen
Available for contract work ( Development / Configuration Management )
http://www.michael-jansen.biz




More information about the kde-core-devel mailing list