How to do logging in a medium size Qt project
i am making a medium size Qt project having around 7 classes and there is a controller class and classes can communicate among themselves too.i want to add error logging feature in it also how can i achieve this.
i would like to mentio that i used qtinstallmessgehandler which to install logger method and its working fine.my main issue is the ideal location to instantiate the singleton logger class so that it is accessible throughout the project.
if anybody have any idea please do it asap
kunal :eek:
Re: How to do logging in a medium size Qt project
Well, you have your message handler, why not use qDebug() << ... ?
In your message handler you can redirect your debug statements to a file, a socket, a tty, ...
Re: How to do logging in a medium size Qt project
Quote:
Originally Posted by
kumarkun
my main issue is the ideal location to instantiate the singleton logger class so that it is accessible throughout the project.
What pattern do you use? The good thing of singletons is that you can use them everywhere without initiate them. So I don't understand you problem. Have a look at the pattern at our wiki.