PDA

View Full Version : Writing To Windows Event Viewer



brixel
3rd May 2016, 13:24
Hello,

Is it possible to write logs to the Windows Event Viewer from Qt? If so, can someone provide a simple example to get me started? Thanks.

anda_skoa
3rd May 2016, 13:48
Assuming Windows has a C or C++ API to write to that, then just calling that should be suffiicient.

Cheers,
_

brixel
4th May 2016, 15:16
Thanks. I ended up just using the QMessageLogger as this does output to the standard debugger for Windows and that will suffice. One additional question though. The QMessageLogContext has "function" as a property which is nice to include, but I was wondering, is there was a way to also derive the arguments that were passed into the function when it was called?

anda_skoa
4th May 2016, 17:30
No, you'll have to log arguments manually.

The arguments could be any type and require type specific handling to get something suitable for logging.

Cheers,
_