Skip to content

Lumberjack.jl: Let's talk about logging

Let’s talk about logging, together

Evan Miller made an interesting observation in his blog recently: “[Julia is] poised to do for technical computing what Node.js is doing for web development — getting disparate groups of programmers to code in the same language.” Well, I agree, and I might take it further. I’d like to see scientists and modelers come together with server-side developers to talk about logging.

Most commonly, logging is something done by web servers. Web servers can be large, complicated programs, with lots of inputs and outputs, and many things can go wrong. So authors of these systems record messages about what is going on while their code runs, and they work to make those messages easier to generate and more and more useful.

In retrospect, the reasons for this approach seem obvious. Fundamentally, logging allows you to look back on how your code is getting used and what happens when it does. Systems with lots of moving parts can be difficult to debug otherwise, especially if you cannot reproduce the complicated set of inputs that caused a problem.

The thing I want to stress is that modelers have all the same problems as server developers, and can benefit from the same approach to logging.

First, debugging can be hard. A good set of debug print messages, built into the code from the start, can save an enormous amount of time. Particularly when more sophisticated debugging tools either don’t exist or are difficult to use.

Second, reproducibility is important. If you let someone run your model, and they encounter a bug, you want to know exactly what they did.

And finally, models can have lots of inputs. In some of the educational simulations we work on, players frequently make more than a dozen separate choices in each round of game play. Knowing what decisions people have entered into your model can yield interesting cultural or design insights. More than that, knowing these decisions can tell you which parts of your model have been touched (and what the results were), and which still need to be tested.

Enter Lumberjack.jl, an open source Julia package for making logs. From the beginning, we developed Lumberjack to be flexible enough to support our developers and modelers alike.

Find examples, check it out, and even contribute on github. I hope it helps no matter how you use Julia.