我正在调用redis命令:
$redis.call ["MEMORY", "USAGE", "Job--9813"]
执行此操作时,我会收到一条消息:
Passing 'call' command to redis as is;
blind passthrough has been deprecated and will be removed in redis-namespace 2.0
(at (pry):37in '<main>')
我理解该警告,但无论如何都想运行代码(针对数十万个 key ),而不用这些消息向我的终端发送垃圾邮件。我怎样才能知道消息来自哪里?我在redis-rb
上搜索 repo ,但找不到任何东西。我怎样才能禁用它?
最佳答案
这是 redis-namespace
中的 Kernel.warn
调用.
您可以使用 -W0
命令行选项禁用 Ruby 中的警告。
有关禁用警告的更多信息:
Suppress Ruby warnings when running specs
关于ruby-on-rails - 如何找出日志消息的来源(并禁用它)?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59039468/