Ruby中的自定义日志记录最佳实践 [英] Custom Logging Best Practices in Ruby
本文介绍了Ruby中的自定义日志记录最佳实践的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
在Ruby中管理自定义日志记录的最佳做法是什么?我应该像猴子记录器那样做我想做的吗?还是从中扩展?还是委派?什么是红宝石方式?我对此感到厌倦了自定义的技巧.我想要更清洁,更理想的是更优雅的东西.
What are best practices for managing custom logging in Ruby? Should I be monkeypatching logger to do what I want? Or extending from it? Or delegating? What's the rubyish way? I'm sick of custom hacks for this; I'd like something cleaner, and ideally more elegant.
推荐答案
根据我的经验,log4r不再受欢迎(而且我不知道为什么这些天我无法访问log4r的主页).相反,记录要好得多.
According to my experience, log4r is no more popular (and I don't know why these days I can't access log4r's homepage). Instead logging is far more better.
FYR
https://www.ruby-toolbox.com/categories/logging
这篇关于Ruby中的自定义日志记录最佳实践的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文