3 @author: Sudheer K. <scifi1947 at gmail.com>
4 @license: GNU General Public License
14 class LogUtility : public QObject
19 LogUtility(QObject *parent = 0) :
24 qDebug() << "Markets Today: In LogUtility object destructor..";
28 void logMessage(QString strMessage) {
30 QString strTimeNow = QDateTime::currentDateTime().toString("dd-MMM-yyyy HH:mm:ss");
31 qDebug() << QString("Markets Today: [%1] - %2").arg(strTimeNow,strMessage);
34 //For maemo use a common path
35 QFile logFile("/home/user/.marketstoday/marketstoday.log");
37 QFile logFile("marketstoday.log");
40 if (!logFile.open(QIODevice::Append | QIODevice::WriteOnly | QIODevice::Text)) { return; }
42 QTextStream logStream(&logFile);
43 logStream << QString("Markets Today: [%1] - %2").arg(strTimeNow,strMessage) << endl;
47 #endif // LOGUTILITY_H