问题
I would like to use the oment++ logging facility for debug logging. For example:
EV_DEBUG << " SASSim::SASSim" << endl;
However, I can't figure out how to set my log level and the logging file in the simulation manual. I thought omnetpp.ini would allow me to specify this. Any pointers on where to look? Thanks.
回答1:
Direct from the manual (10.6.4):
https://omnetpp.org/doc/omnetpp/manual/#sec:config-sim:configuring-cmdenv
In Cmdenv, logging can be configured using omnetpp.ini configuration options. The configured settings remain in effect during the whole simulation run unless overridden programatically.
cmdenv-output-file
redirects standard output to a filecmdenv-log-prefix
determines the log prefix of each line<object-full-path>.cmdenv-log-level
restricts output on a per-component basis
i.e. you can write:
**.phy.cmdenv-log-level = warn
to set the log level for all modules named phy
Qtenv and Tkenv have their own dialogs where you can set the log level interactively.
来源:https://stackoverflow.com/questions/42982187/omnet-configuring-logging