Skip to content

Commit

Permalink
ClientServerChannel log enhancement (#4)
Browse files Browse the repository at this point in the history
* less verbose by default
* log level configurable
* added log macros for ClientServerChannel 

Co-authored-by: Felix Hilgerdenaar <[email protected]>
  • Loading branch information
fhilg and Felix Hilgerdenaar authored Oct 6, 2021
1 parent 45c80a9 commit 429da0a
Show file tree
Hide file tree
Showing 6 changed files with 434 additions and 160 deletions.
2 changes: 2 additions & 0 deletions premake5.lua
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,8 @@ project "omnetpp-federate-LIBRARY"
, "src/mgmt/*.cc"
, PROTO_CC_PATH .. "/ClientServerChannel.h"
, PROTO_CC_PATH .. "/ClientServerChannel.cc"
, "src/util/Log.h"
, "src/util/Log.cc"
, PROTO_CC_PATH .. "/ClientServerChannelMessages.pb.h"
, PROTO_CC_PATH .. "/ClientServerChannelMessages.pb.cc"
}
Expand Down
4 changes: 1 addition & 3 deletions src/node/MosaicProxyApp.cc
Original file line number Diff line number Diff line change
Expand Up @@ -149,8 +149,6 @@ void MosaicProxyApp::sendDelayedToUDP(omnetpp::cPacket *msg, int srcPort, const
* triggered from MosaicScenarioManager and hence from Mosaic.
*/
void MosaicProxyApp::sendPacket(omnetpp::cMessage *msg) {
EV << "MosaicUDP send packet" << std::endl;

auto *packet = inet::check_and_cast<MosaicAppPacket *>(msg);
auto destAddr = packet->getDestAddr();
double delay = dblrand() * maxProcDelay;
Expand All @@ -167,7 +165,7 @@ void MosaicProxyApp::receivePacket(omnetpp::cMessage *msg) {
auto udp_packet = inet::check_and_cast<inet::Packet*>(msg);
auto cPacket = udp_packet->popAtBack<inet::cPacketChunk>().get()->getPacket();
auto packet = omnetpp::check_and_cast<MosaicAppPacket*>(cPacket);
EV << "MosaicUDP: srcNodeId " << packet->getNodeId() << ", msgId " << packet->getMsgId() << std::endl;
EV << "srcNodeId " << packet->getNodeId() << ", msgId " << packet->getMsgId() << std::endl;
packet->setNodeId(m_externalId);

send(packet->dup(), gate("fedOut"));
Expand Down
28 changes: 20 additions & 8 deletions src/omnetpp.ini
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,22 @@ simtime-resolution=1ns
# --------------
# scheduler-class and debugging option for more verbose logging
scheduler-class = "omnetpp_federate::MosaicEventScheduler"
mosaiceventscheduler-debug = true
mosaiceventscheduler-debug = false
# connection settings, when omnetpp-federate is started manually
mosaiceventscheduler-host = "localhost"
mosaiceventscheduler-port = 4998

# ClientServerChannel
# -------------------
# OMNeT++ log level names are valid, same hierarchy is used
clientserverchannel-log-level = warn

# RecordingModi
# -------------
record-eventlog = false
cmdenv-express-mode = false
cmdenv-event-banners = false
cmdenv-log-prefix = "%t: "
cmdenv-log-prefix = "%t: [%M] "

# random numbers
# -------------
Expand All @@ -29,12 +34,19 @@ Simulation.mobility.rng-0 = 1
Simulation.wlan[*].mac.rng-0 = 2

# general logging output
# --------------
#*.mgmt.cmdenv-ev-output = false
*.mgmt.debug = false
#*.veh[*].**.cmdenv-ev-output = false
#*.rsu[*].**.cmdenv-ev-output = false

# ----------------------

# These are setting suggestions for verbosity levels
# which are equivalent to MOSAIC's log level INFO and DEBUG
#
# MOSAIC log level equivalent: INFO DEBUG
#---------------------------------------------------
**.tx.cmdenv-log-level = info # = info
**.rx.cmdenv-log-level = info # = info
**.proxyApp.cmdenv-log-level = info # = info
Simulation.mgmt.cmdenv-log-level = info # = info

**.cmdenv-log-level = warn # = info # This sets everything to level INFO

########### application settings ############
#Simulation.rsu[*].udpApp.maxProcDelay = 1e-3
Expand Down
Loading

0 comments on commit 429da0a

Please sign in to comment.