Skip to content

Python logging

In creating a command line utility to remove links from archives I went looking for some of the professional developer features of python. The utility provided an opportunity to see what these did. The two major features put in that utility were argument parsing and logging. It was rather obvious from setting up these features in the utility that both had a lot of depth to cover most needs one might want for parsing arguments and keeping track of program operation.

Understanding logging in Python at Mussol Blog has a good summary to provide context for just how complex logging can be.

“Once you understand the main concepts, logging with the Python standard library it’s actually quite pleasant and flexible. It allows you to configure complex logging architectures and modify its behavior without having to modify your application code.

Logging is very important for any application to gather analytics, detect anomalies and troubleshooting. Hopefully this blog post has enlightened you a little bit and you’re excited to try out a good logging configuration :smile:.”

Parsing arguments is a close cousin to logging because a utility would want to allow modification of logging at the command line. I’ll be getting my utility in the code repository before long so you can see what I mean.