I have a lot of questions about Qdebug and a way to have control on the messages emited by my progam.


Does it make sense to create an instance of qdebug ? and If yes, how can I create it ?
Can I say it 'Send the messages to this listbox' ?


I have my own debug class, (in order to save the messages in a log file, send them to a listbox, etc ) that use :
Qt Code:
  1. mydebug & mydebug('type' value) {
  2. code....
  3. return *this}
To copy to clipboard, switch view to plain text mode 

I use it in this way:
mydebug()<<"hello"<<variable<<" is "<< "";
It works fine.

Ok, to show or send the message stored (into a string ) I have to use <<""; at the end, because it is the only way to know that the user has ended to send data.
I dont know how Qdebug can do it . For example
qDebug()<<"hello"; ->>> sends "hello" to the application output of QtCreator.
qDebug()<<"hello"<<" peter"; ->>> sends "hello peter" to the application output of QtCreator.
Is there some magical way to do ' Hey , wait, because you are receiving more data' and ' Hey, the ";" is reached'
In other words, I'd like to know when I am receive some << data and when I have no more <<.

And a last question, about using it inside const functions.
I create a public mydebug object to use in several places in my class.
Qt Code:
  1. Mydebug mydebug; ......
  2. mydebug<<"data";
To copy to clipboard, switch view to plain text mode 
Ok, I have errors related to constness (... discard cualifiers....)
( I imagine that this is becasue mydebug functions returns references to itself)
However I can use mydebug()<<"data";
Any way to avoid this ?

I understand that are many questions, can anybody help me ? Some ideas?
Thanks.