[Ns-bugs] [Bug 1286] New: LogComponentEnableAll(LOG_LEVEL_ALL) not working as intended (output blocked)
code@nsnam.ece.gatech.edu
code at nsnam.ece.gatech.edu
Sun Oct 30 13:34:43 PDT 2011
https://www.nsnam.org/bugzilla/show_bug.cgi?id=1286
Summary: LogComponentEnableAll(LOG_LEVEL_ALL) not working as
intended (output blocked)
Product: ns-3
Version: pre-release
Platform: All
OS/Version: Mac OS
Status: NEW
Severity: normal
Priority: P3
Component: ipv6
AssignedTo: vincent at clarinet.u-strasbg.fr
ReportedBy: tommaso.pecorella at unifi.it
CC: ns-bugs at isi.edu
Estimated Hours: 0.0
If you set LogComponentEnableAll(LOG_LEVEL_ALL) the output hangs after some
function calls. The simulation goes on, but no log is sent.
I don't know if this a MacOS specific issue, but I tracked it down, and the
issue seems to be that "primitive" types, like uint8_t, can not use directly
the ostreams.
Example:
uint8_t Ipv6Extension::ProcessOptions (Ptr<Packet>& packet, uint8_t offset,
uint8_t length, Ipv6Header const& ipv6Header, Ipv6Address dst, uint8_t
*nextHeader, bool& isDropped)
{
NS_LOG_FUNCTION (this << packet << offset << length << ipv6Header << dst <<
nextHeader << isDropped);
[...]
}
does block the output.
The issue is solved with an explicit cast:
uint8_t Ipv6Extension::ProcessOptions (Ptr<Packet>& packet, uint8_t offset,
uint8_t length, Ipv6Header const& ipv6Header, Ipv6Address dst, uint8_t
*nextHeader, bool& isDropped)
{
NS_LOG_FUNCTION (this << packet << int(offset) << int(length) << ipv6Header
<< dst << (int*)(nextHeader) << isDropped);
[...]
}
The only problems are:
1) is this a MacOS specific issue or it's happening also on other platforms?,
and,
2) how to fix it in a "generic" way? I fear that the issue is quite spread
among the whole ns-3 code.
--
Configure bugmail: https://www.nsnam.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.
More information about the Ns-bugs
mailing list