Time for us to continue with our ongoing series, in which we teach you how to get started logging quickly in a variety of programming languages. We started out the series with C#, we proceeded to cover Java, and then we wrote about Python.
So, what about tipping the scale to the side of dynamically-typed interpreted languages? That’s exactly what we’re doing today by teaching you how to get up and running with logging, using the Ruby programming language.
Today’s post will follow the basic structure that’s been used in the previous articles. It will cover
- How to implement a very rudimentary logger.
- A discussion on the fundamentals of logging: why bother logging, which data to log, and where to log.
- Finally, a very simple yet realistic example of proper logging, with help from the Ruby “Logger” class.
Like the previous installments of the series, we’ll create a very simple toy app in order to demonstrate how to log. As we’ve just said, we’re going to start with a very primitive—though functional—approach, and we’ll then evolve it toward a more sophisticated and realistic solution.