Legend:
- Unmodified
- Added
- Removed
-
trunk/BNS/bns.cpp
r811 r812 55 55 _outFile = new QTextStream(&outFile); 56 56 } 57 58 // Log File 59 // -------- 60 _logFile = 0; 61 QFile logFile(settings.value("logFile").toString()); 62 if (logFile.open(QFile::WriteOnly | QFile::Truncate)) { 63 _logFile = new QTextStream(&logFile); 64 } 57 65 } 58 66 … … 64 72 /// delete _clkSocket; 65 73 delete _outSocket; 74 delete _outFile; 75 delete _logFile; 66 76 QMapIterator<QString, t_ephPair*> it(_ephList); 67 77 while (it.hasNext()) { … … 85 95 //////////////////////////////////////////////////////////////////////////// 86 96 void t_bns::slotMessage(const QByteArray msg) { 87 cout << msg.data() << endl; 97 if (_logFile) { 98 *_logFile << msg << endl; 99 } 88 100 emit(newMessage(msg)); 89 101 } … … 92 104 //////////////////////////////////////////////////////////////////////////// 93 105 void t_bns::slotError(const QByteArray msg) { 94 cerr << msg.data() << endl; 106 if (_logFile) { 107 *_logFile << msg << endl; 108 } 95 109 deleteBnsEph(); 96 110 emit(error(msg)); -
trunk/BNS/bns.h
r811 r812 53 53 QTcpSocket* _outSocket; 54 54 QTextStream* _outFile; 55 QTextStream* _logFile; 55 56 t_bnseph* _bnseph; 56 57 QMutex _mutex;
Note:
See TracChangeset
for help on using the changeset viewer.