Every developer has a set of modules they always use in some mutated form or another. I’m starting this series of posts to document all my Goto Modules. Starting off with my goto Python Logging module. I currently have two main variants of this module which I use regularly.
Console and File
This variant allows configurable level logging to the console and to a file. It sets up a rotating file handler that will keep 20 previous files and
rotate them when they reach 10MB.
Console & Errors to Bugsnag
Similar to the last one, however its more orientated to container work where you don’t need/want a log file. It also includes
error logging to BugSnag.
Most logging platforms in modern languages generally encourage loading log configuration from a separate file. I am not a fan of this of this approach
for small to medium projects. My reasoning is I always try keep the number of files I ship to a minimum to keep things simple.
I almost always think if you are going to give the end user the option to adjust their log settings then they should do so from a UI or a command line