29 Jan 2022
Every single program you write needs to write a log. This includes everything from the command line utility you wrote to large monolith application that runs your business.
Why? I have already talked about how I don’t want to debug your code. I have also defined some rules on how I want to debug your code when I have to by showing me your variables and initializing members together. Life would be great if I had never had to fire up the debugger in the first place. That can only happen if you write a log for me to look at.
I have lived in the corporate software world long enough to encounter thousands custom business programs. They do all sorts of things. They each have their own timeframe for running on what could be called a schedule. Imagine a program that is run once every seven (7) years to provide the business with compliance information to be used during a scheduled audit. Yeah, stuff like that happens.
Others have been incredibly small but performed critical business functions. Some have been large and rarely used. In all but a few cases the original developers were long gone. The code was years old. The languages used and tools available were old and barely supported.
You need to write a log. Some IT departments are pretty good at slurping up logs into a fairly centralized system that supports searching. Others are less than optimal and required tickets to get copies from physical servers. The world is not perfect but, in most cases, there were logs.
Here are my logging rules for your programs to help everyone:
Starting Mighty Little Command Utility Line v1.0
. If you are following
rule #1 then I won’t have to look very far. Believe me, nothing is more
annoying than having to debug your WinForms application that the business
requires, that produces no output, displays no user interface, and has no
log.I'm Done
it would make everyone’s life so easy. I would
have not seen that message and saved myself three (3) days worth of work.The rules are simple. All programs should produce something along the following so everyone can see what is happening.
Starting Mighty Little Command Utility Line v1.0
Using default configuration file => /home/kenbr/config/mighty.config
Completed successfully!