PDA

View Full Version : QxtLogger Question



photo_tom
28th February 2010, 16:31
I have an application where I'm looking at using a event/debug logger and QxtLogger looks like a possibility.

However, my problem is that in reviewing the documentation, I don't' see how to set the output file name for the log files. I'm probably missing the obvious, but I could use some help.

kalinga_ray
5th July 2010, 09:23
Please someone answer the above question.

Also i have another doubt.If this QxtLogger is not part of standard Qt who takes the responsibility of installing its libraby so that any application uses this lib does not break in the device.

Br,
Kalinga

photo_tom
5th July 2010, 14:20
Please someone answer the above question.

Also i have another doubt.If this QxtLogger is not part of standard Qt who takes the responsibility of installing its libraby so that any application uses this lib does not break in the device.

Br,
Kalinga


After having used the library now for a couple of months, I've found it very reliable and easy to use. To answer your questions
1 - For installation issues, it is just a matter of copying qxt dll's.
2 - As far as" break in device", it only uses only Qt functions. So it is basically as reliable as qt is.

Tom

kalinga_ray
6th July 2010, 14:24
Thanks Tom,
I have a small doubt.If every single application who uses QxtLogger will install qxt dll's would not it be a problem.
Is it better idea to modify the source and create own dll for this purpose.
And to answer your question in the first post
you look at QxtAbstractFileLoggerEngine ( const QString & fileName, QIODevice::OpenMode mode )
while creating the engine you can specify the log output file name.
Anyway i guess you would have figured out as you have mentioned you are using it for couple of months.

Thanks,
Kalinga

photo_tom
7th July 2010, 01:47
Thanks for reply. Actually, I currently have written 5 different logging engines. And I am using QxtAbstractFileLoggerEngine in 3 different custom overloads now.
Once, you really start to understand how it works, it really is a very elegant design.

While I cannot post our proprietary code here, there is one thing we did that has really made the logger very useful. However, I can describe it. What I did was create a series of macros names LOGWITHNAMESx() that would generate the call to the logger that would output both the name of the variable and it's contents. So LOGWITHNAMES2(foo,bar) would output in the log file
--- foo=, <contents foo>, bar=, <contents bar> ---.
This has helped with proven to be extremely helpful in troubleshoots.

Tom

kalinga_ray
7th July 2010, 06:18
Thanks Tom for your quick reply.
If i install a "qInstallMsgHandler" i can control over all debug output.
what extra i can do using a engine, that i couldn't do using qInstallMsgHandler.

please share your understanding about some of my below doubt if you have any idea.
i) If multiple applications who use QxtLogger will install qxt dll's would not it be a problem.
ii) Is it better idea to modify the source and create own dll for this purpose.
iii) How many dll's qxt package creates and if its creating multiple dlls can i install the one corresponding to logging only.
any idea whether its supporting Symbian s60 or future symbian.

Thanks in advance.

photo_tom
7th July 2010, 11:45
Actually, there isn't that much. Qxtlogger and QDebug are two different approaches to solving the same problem. The biggest difference is that the logger allows you to easily contol what levels of output you want outputted at run-time. If you use the QDebug, you have to implement the dynamic level control yourself.

On balance, we've found Qxtlogger to be more flexible.

Tom