[Qt-interest] qDebug output for Windows Service (no console)?

Jon Nicoll jkn+qt at nicorp.co.uk
Tue Sep 1 18:05:37 CEST 2009


Hi all
I'm a newcomer to Qt but a relatively experienced programmer, just a bit
rusty under Win32. I'm working on a VS.NET project which can be built
either as a console app, or as a windows service. I'm having trouble
getting debug output when built as a service.

I'm using qDebug which according to the (Qt v4.5) documentation, "sends
output to the console, if it is a console output, otherwise, to the
debugger". This works fine when built as a console app, ie. I get debug
output on the consile.

When built as a service, of course there is no console, and I don't want
one either. I have installed SysInternals' DebugView, which I've used
before, to capture the debug output. But I'm getting nothing coming up of
the DebugView screen. I can generate 'test' debug messages using a
separate app (using Python, as it happens) and they show up fine. I know
that my Qt Service Application is generating messages as I can see its
operation as a service. So I'm missing simething in the chain here ...

Various bits of documentation I've seen talk about adding CONFIG +=
console in my '.pro' file. But I don't want a console! I have not got
QT_NO_DEBUG_OUTPUT defined anywhere FWIW.

So, what else might I need to do to cause calls to qDebug to arrive at
DebugView with my Windows Service build?

Thanks for any suggestions.

J^n




More information about the Qt-interest-old mailing list