I need a logger for my application (no console application), wich shall fit following requirements:
- Preformatted text for my message, e.g.
[MyApp] on 01.02.2015_12:12:12:123 : Library calc.dll load - OK
- Output to console (seperate window shell@linux or cmd@windows etc. additional to my WidgetWindow)
- Output to file for each application run, I want to create a debug-.log
For instance I only forward "Library calc.dll load - OK" to the debug function, which then creates the final string "[MyApp] on 01.02.2015_12:12:12:123 : Library calc.dll load - OK"
Here I have a WidgetApp with a MainWindow. In that MainWindow I can toggle in the MainMenu a checkbox "Activate logging". When that is activated, a second window (basically a console) should be opened, where all the debug output is written.
And that very same output shall be able to be written to a file as well.
The qInstallMessageHandler was recommended in my previous question, but its documentation says:
With Windows, if it is a console application, the text is sent to console; otherwise, it is sent to the debugger.
Since my MainWindow is a Widget, I think that does not work for me? I would prefer Qt libs.
Aucun commentaire:
Enregistrer un commentaire