Recently, I have been writing a fairly large and generic system for ingesting various satellite images onto a common grid and producing user specified plots and reports from the results. Control of the system is done via a configuration file, like this one, which has been a great, flexible way to handle users extending and controlling the system. But reading the recent IDL Data Point article about Jim Pendleton’s DebuggerHelper class reminded me how useful a logging framework is for medium to large sized projects.

I use mg_log as my logging utility. It is simple to use, but has some powerful features for filtering and customizing output. It has five levels (debug, informational, warning, error, and critical) of messages which match the overall system level. This allows you to filter messages based on severity, e.g., during development you can set the logging level to “debug” and then all messages will appear. Later, when you have deploy the system, users may find setting the level to “warning” (which does not show the debug and informational messages) to be more appropriate.

See this article to learn more about mg_log basics. This sample log shows what the typical output looks like, though the format for each line is completely configurable. mg_log is available on GitHub in my mglib repo.