调试 wireshark 解剖器

Debugging wireshark dissector

我正在编写我的第一个 wireshark 解析器。我在 Lua 中使用 this as an example. On the second page 编写它,它说我可以使用 critical()、warn()、debug() 等函数来帮助调试代码。但是,当我添加最简单的

critical("foo")

wireshark 抱怨

attempt to call global 'critical' (a nil value)

我似乎不知道如何使用这些实用函数。我错过了什么?

更新: 如果相关,我是 运行 Wireshark 3.0.0

我做了那个教程。

Wireshark 3.0 中似乎删除了日志记录功能 (release notes):

Lua: the various logging functions (debug, info, message, warn and critical) have been removed. Use the print function instead for debugging purposes.

因此请改用 print()

print("foo")