omnet++:配置日志记录 [英] omnet++: Configuring logging
问题描述
我想使用 oment++ 日志记录工具进行调试日志记录.例如:
I would like to use the oment++ logging facility for debug logging. For example:
EV_DEBUG << " SASSim::SASSim" << endl;
然而,我无法弄清楚如何在模拟手册中设置我的日志级别和日志文件.我认为 omnetpp.ini 将允许我指定这一点.关于在哪里看的任何指示?谢谢.
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.
推荐答案
直接来自手册 (10.6.4):
Direct from the manual (10.6.4):
https://omnetpp.org/doc/omnetpp/manual/#sec:config-sim:configuring-cmdenv
在 Cmdenv 中,可以使用 omnetpp.ini 配置选项配置日志记录.除非以编程方式覆盖,否则配置的设置在整个模拟运行期间保持有效.
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
将标准输出重定向到文件
cmdenv-output-file
redirects standard output to a file
cmdenv-log-prefix
决定每一行的日志前缀
cmdenv-log-prefix
determines the log prefix of each line
即你可以写:
**.phy.cmdenv-log-level = 警告
**.phy.cmdenv-log-level = warn
为所有名为 phy
Qtenv 和 Tkenv 有自己的对话框,您可以在其中以交互方式设置日志级别.
Qtenv and Tkenv have their own dialogs where you can set the log level interactively.
这篇关于omnet++:配置日志记录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!