[英]Prevent Maruku from posting so many log warnings
I use Maruku in Rails simply to convert a Markdown file to HTML so I can use it with Nokogiri. 我在Rails中使用Maruku只是将Markdown文件转换为HTML,以便可以与Nokogiri一起使用。 (Maybe there's a better solution for that?) That works fine, but I get lots and lots of "Maruku tells you" messages in the log:
(也许有一个更好的解决方案?)这很好,但是我在日志中收到很多“ Maruku告诉你”消息:
___________________________________________________________________________
| Maruku tells you:
+---------------------------------------------------------------------------
| Could not find ref_id = "FIX" for md_link("FIX", nil)
| Available refs are []
+---------------------------------------------------------------------------
That's really confusing and not needed here. 这确实令人困惑,这里不需要。 Is there a way to silence Maruku so it only warns in the log if there's a real error?
有没有办法使Maruku保持沉默,以便仅在出现真正错误时才在日志中发出警告?
Looking at the source code and documentation , it looks like you can set :on_error
to :ignore
: 查看源代码和文档 ,您似乎可以将
:on_error
设置为:ignore
:
Maruku.new(string, :on_error => :ignore)
It might also silence "real errors", though. 但是,它也可能使“实际错误”保持沉默。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.