Changeset 11185 in ntrip for trunk/BNC/src/bnccaster.cpp


Ignore:
Timestamp:
Nov 9, 2026, 12:15:48 PM (12 hours ago)
Author:
stuerze
Message:

Structured logging improved

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/BNC/src/bnccaster.cpp

    r11021 r11185  
    6464  bncSettings settings;
    6565
    66   connect(this, SIGNAL(newMessage(QByteArray,bool)),
    67           BNC_CORE, SLOT(slotMessage(const QByteArray,bool)));
     66  BNC_CORE->connectMessages(this, "bnc");
     67  BNC_CORE->connectLogRecords(this, "bnc");
    6868
    6969  _outFile = 0;
    … …  
    8181                      + QByteArray::number(port) + ": "
    8282                      + _server->errorString();
    83       emit newMessage(message.toLatin1(), true);
     83      emit newLogRecord(t_logRecord::message(t_logRecord::error, message.toLatin1()), true);
    8484    }
    8585    connect(_server, SIGNAL(newConnection()), this, SLOT(slotNewConnection()));
    … …  
    9999                      + QByteArray::number(uPort) + ": "
    100100                      + _uServer->errorString();
    101       emit newMessage(message.toLatin1(), true);
     101      emit newLogRecord(t_logRecord::message(t_logRecord::error, message.toLatin1()), true);
    102102    }
    103103    connect(_uServer, SIGNAL(newConnection()), this, SLOT(slotNewUConnection()));
    … …  
    128128                      + QByteArray::number(_miscPort) + ": "
    129129                      + _miscServer->errorString();
    130       emit newMessage(message.toLatin1(), true);
     130      emit newLogRecord(t_logRecord::message(t_logRecord::error, message.toLatin1()), true);
    131131    }
    132132    connect(_miscServer, SIGNAL(newConnection()), this, SLOT(slotNewMiscConnection()));
    … …  
    235235        if ( !settings.value("outFile").toString().isEmpty() ||
    236236             !settings.value("outPort").toString().isEmpty() ) {
    237           emit( newMessage(QString("%1: Old or erroneous observation epoch %2 thrown away from %3")
     237          emit newLogRecord(t_logRecord::message(t_logRecord::warning, QString("%1: Old or erroneous observation epoch %2 thrown away from %3")
    238238                           .arg(staID.data())
    239239                           .arg(string(obs._time).c_str())
    240240                           .arg(obs._prn.toString().c_str())
    241                              .toLatin1(), true) );
     241                             .toLatin1()), true);
    242242        }
    243243      }
    … …  
    262262void bncCaster::slotNewConnection() {
    263263  _sockets->push_back( _server->nextPendingConnection() );
    264   emit( newMessage(QString("New client connection on sync port: # %1")
    265                    .arg(_sockets->size()).toLatin1(), true) );
     264  emit newLogRecord(t_logRecord::message(t_logRecord::info, QString("New client connection on sync port: # %1")
     265                   .arg(_sockets->size()).toLatin1()), true);
    266266}
    267267
    268268void bncCaster::slotNewUConnection() {
    269269  _uSockets->push_back( _uServer->nextPendingConnection() );
    270   emit( newMessage(QString("New client connection on usync port: # %1")
    271                    .arg(_uSockets->size()).toLatin1(), true) );
     270  emit newLogRecord(t_logRecord::message(t_logRecord::info, QString("New client connection on usync port: # %1")
     271                   .arg(_uSockets->size()).toLatin1()), true);
    272272}
    273273
    … …  
    318318  }
    319319  _staIDs.removeAll(staID);
    320   emit( newMessage(
    321            QString("Decoding %1 stream(s)").arg(_staIDs.size()).toLatin1(), true) );
     320  emit newLogRecord(t_logRecord::message(t_logRecord::info, QString("Decoding %1 stream(s)").arg(_staIDs.size()).toLatin1()), true);
    322321  if (_staIDs.size() == 0) {
    323322    emit getThreadsFinished();
    … …  
    482481
    483482  emit mountPointsRead(_threads);
    484   emit(newMessage(QString("Configuration read: " + BNC_CORE->confFileName() + ", %1 stream(s)").arg(_threads.count()).toLatin1(), true));
     483  emit newLogRecord(t_logRecord::message(t_logRecord::info, QString("Configuration read: " + BNC_CORE->confFileName() + ", %1 stream(s)").arg(_threads.count()).toLatin1()), true);
    485484
    486485  // (Re-) Start the configuration timer
    … …  
    586585void bncCaster::slotNewMiscConnection() {
    587586  _miscSockets->push_back( _miscServer->nextPendingConnection() );
    588   emit( newMessage(QString("New client connection on Miscellaneous Output Port: # %1")
    589                    .arg(_miscSockets->size()).toLatin1(), true) );
     587  emit newLogRecord(t_logRecord::message(t_logRecord::info, QString("New client connection on Miscellaneous Output Port: # %1")
     588                   .arg(_miscSockets->size()).toLatin1()), true);
    590589}
    591590
Note: See TracChangeset for help on using the changeset viewer.