Hacker News new | ask | show | jobs
by DanielRibeiro 5380 days ago
Even for ruby you can find many logging libraries:

https://github.com/parolkar/active_log

https://github.com/colbygk/log4r

https://github.com/TwP/logging

https://github.com/relevance/log_buddy

I believe one of the reasons is that logging is not a simple problem, but it is ubiquitous to all applications.

It is not simple because:

1. your logging is usually a crosscutting concern to applications, and is really fit for Aspect Oriented Programming Mechanisms.[1] In language with mixins, like Ruby and Scala, this is not a big issue, as you don't need full AOP to solve this. AspectJ is not really widespread, and adds quite a lot of complexity to a small project, and is not standard Java, which makes a bad situation worse on Java.

2. your logging must be easy to disable, and only compute what it is actually needed. With languages with closures and Ast Metaprogramming, like Lisp Macros, you can do this very easily. Scala is particularly suitable to this, as you can use call by name[2] semantics to make the closures implicit.

[1] http://en.wikipedia.org/wiki/Aspect-oriented_programming

[2] http://www.scala-lang.org/node/138