rld 是一个非交互的调试工具,用于调试 Redis 的 Lua 脚本,这里有篇详细介绍的文章。
rld 特性包括:
易于安装,只有 6kB
可打印输出到本地和远端
跟踪执行的代码行
先进的数值变化的自动监控机制报告
报告函数调用、返回和参数可进行实时检查
基本使用:
Load rld.lua to Redis once (e.g. redis-cli --eval rld.lua).
redis-cli --eval rld.lua
Add this line at the beginning of your Lua script: rld.start().
rld.start()
Run your code as usual (e.g. redis-cli --eval prog.lua).
redis-cli --eval prog.lua
View rld’s output in Redis’ log file or by subscribing to the rld channel.
rld
rld.start() - starts the debugger
rld.stop() - stops the debugger
rld.stop()
rld.troff() / rld.tron() - toggles tracing off/on
rld.troff()
rld.tron()
rld.options - debugger options, see source for details
rld.options