Changeset 11185 in ntrip for trunk/BNC/src/bnccore.cpp
- Timestamp:
- Nov 9, 2026, 12:15:48 PM (6 hours ago)
- File:
-
- 1 edited
-
trunk/BNC/src/bnccore.cpp (modified) (9 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/BNC/src/bnccore.cpp
r11179 r11185 73 73 _logFileStructured = 0; 74 74 _logFormatStructured = t_logRecord::json; 75 _logLevelStructured = t_logRecord::debug; 75 76 _rawFile = 0; 76 77 _caster = 0; … … 149 150 } 150 151 slotLogRecord(t_logRecord::fromMessage(msg), showOnScreen); 152 } 153 154 // Write a Program Message of a component with an explicit level 155 //////////////////////////////////////////////////////////////////////////// 156 void t_bncCore::message(const QByteArray& msg, bool showOnScreen, const QByteArray& component, 157 t_logRecord::e_level level) { 158 if (msg.isEmpty()) { 159 return; 160 } 161 slotLogRecord(t_logRecord::message(level, msg, component), showOnScreen); 162 } 163 164 // Write a Program Message of a component 165 //////////////////////////////////////////////////////////////////////////// 166 void t_bncCore::message(const QByteArray& msg, bool showOnScreen, const QByteArray& component) { 167 if (msg.isEmpty()) { 168 return; 169 } 170 slotLogRecord(t_logRecord::fromMessage(msg, component), showOnScreen); 151 171 } 152 172 … … 199 219 _logFormatStructured = t_logRecord::formatFromString( 200 220 settings.value("logFormatStructured").toString()); 221 _logLevelStructured = t_logRecord::levelFromString( 222 settings.value("logLevelStructured").toString()); 201 223 _logFileStructured = new QFile(structName + "_" + currDate.toString("yyMMdd")); 202 224 if (!_logFileStructured->open(append ? (QIODevice::WriteOnly | QIODevice::Append) … … 219 241 } 220 242 221 if (_logFileStructured) { 243 if (_logFileStructured && rec._level >= _logLevelStructured) { 222 244 _logFileStructured->write(rec.encode(_logFormatStructured, currDateTime) + "\n"); 223 245 _logFileStructured->flush(); … … 232 254 #ifdef BNC_DEBUG_BCE 233 255 if (eph->checkState() == t_eph::unhealthy) { 234 messagePrivate(t_logRecord:: fromMessage(QString("%1: UNHEALTHY %2:%3")256 messagePrivate(t_logRecord::debugMessage("bce", QString("%1: UNHEALTHY %2:%3") 235 257 .arg(eph->receptStaID()) 236 258 .arg(eph->typeStr(eph->type(), eph->prn(), 99.0)) … … 238 260 } 239 261 if (eph->checkState() == t_eph::bad) { 240 messagePrivate(t_logRecord:: fromMessage(QString("%1: WRONG %2:%3")262 messagePrivate(t_logRecord::debugMessage("bce", QString("%1: WRONG %2:%3") 241 263 .arg(eph->receptStaID()) 242 264 .arg(eph->typeStr(eph->type(), eph->prn(), 99.0)) … … 244 266 } 245 267 if (eph->checkState() == t_eph::outdated) { 246 messagePrivate(t_logRecord:: fromMessage(QString("%1: OUTDATED %2:%3")268 messagePrivate(t_logRecord::debugMessage("bce", QString("%1: OUTDATED %2:%3") 247 269 .arg(eph->receptStaID()) 248 270 .arg(eph->typeStr(eph->type(), eph->prn(), 99.0)) … … 633 655 + QByteArray::number(_portEph) + ": " 634 656 + _serverEph->errorString(); 635 slot Message(message.toLatin1(), true);657 slotLogRecord(t_logRecord::message(t_logRecord::error, message.toLatin1(), "bnc"), true); 636 658 } 637 659 connect(_serverEph, SIGNAL(newConnection()), this, SLOT(slotNewConnectionEph())); … … 653 675 + QByteArray::number(_portCorr) + ": " 654 676 + _serverCorr->errorString(); 655 slot Message(message.toLatin1(), true);677 slotLogRecord(t_logRecord::message(t_logRecord::error, message.toLatin1(), "bnc"), true); 656 678 } 657 679 connect(_serverCorr, SIGNAL(newConnection()), this, SLOT(slotNewConnectionCorr()));
Note:
See TracChangeset
for help on using the changeset viewer.
