I have been looking into changing the standard progress output of the installer along with enhancements to the log output. There are a few ways we can go with this as well as some smaller changes to increase the debuggability of the log files.
There are a number of items to unpack and weigh in on here. I would really appreciate if folks gave in-depth thoughts or even just simple replies with which aspects they like to help guide the changes in this area.
Progress Output
When we think about running the installer in itās standard way (no verbose mode or modification to log levels) there are two ways I think we could approach it. The current method of using a progress bar but breaking out the steps to show progress step by step or a log-style approach.
Option 1: Progress Bar Style
The first option is continuing with the progress bar theme but breaking this out by stage of the installer, showing progress for each stage and elapsed time and then moving on to the next step without erasing the previous one from the screen. This gives more of a sequence feel to the process and could include things like total number of steps and what step the process is currently on.
Added this based on feedback to show a progress style output but using step counts rather than bars:
Option 2: Log Based
The second option is to unify the log file output with the progress output from running the installer to be the same output in both places. This would keep the output the same no matter where a user looked and be affected by verbosity levels where a user wanted to run installation with more information, or run it in noop mode but with more details. This method is not as nice to look at but is straight forward.
Log Formatting Changes
The current installer log output and formatting prints the following information:
- date and time
- log level
- logger name
- message
For this proposal, Iād like to modify both what gets printed and the formatting of that data as it appears in the log file or on the screen when using verbose mode.
Log Data
The only proposed change here is to drop the name of the logger (e.g. verbose, main) since that has no contextual value to a user debugging. Instead, replace this with the stage the installer is at to better understand where an error might be coming from. For example, this would denote if the installer was running a boot hook, pre hook, puppet apply or post install hook. Further, actions within a hook could denote themselves as a stage and provide further context. For example, package unlocking could identify itself as a stage, e.g.
2020-08-13 09:14:44 INFO [init] Warming up
2020-08-13 09:14:45 INFO [boot] Executing boot hooks
2020-08-13 09:14:46 INFO [package_unlock] Package versions are being unlocked
2020-08-13 09:14:46 INFO [pre] Executing pre configure hooks
Log Format
This topic area relates to how the data is arranged within the log at a line by line level. This aims to take into account readability, the types of data we want to display and some bit of reading and thinking of formats that may enhance visual parsing.
Current Format:
[INFO 2020-08-13T09:10:51 init] Warming up
[INFO 2020-08-13T09:10:52 boot] Executing boot hooks
[INFO 2020-08-13T09:10:53 package_unlock] Package versions are being unlocked
[INFO 2020-08-13T09:10:53 pre] Executing pre configure hooks
[WARN 2020-08-12T20:45:50 configure] Stage[main]/Foreman_proxy::Module::Logs/Foreman_proxy::Module[logs]/Foreman_proxy::Feature[Lo
gs]/Datacat_fragment[foreman_proxy::enabled_features::Logs]: Skipping because of failed dependencies
[ERROR 2020-08-13T09:10:54 configure] Puppet apply error
Here I have presented 3 options from my reading to think about and spark conversation. Feel free to either reply and say you like one, to propose a new formatting all together or propose some tweaks to one.
Also, in the below option examples I have chosen to spit the date to be separated by a space rather than the T
character that is part of the ISO 8601 format. I did this to show a different possibility from our current format and because I personally find it easier to read when debugging. Please do share regarding this as well.
Option 1
Move the date to the left, and only wrap the stage in brackets to emphasize.
2020-08-13 09:13:38 INFO [init] Warming up
2020-08-13 09:13:39 INFO [boot] Executing boot hooks
2020-08-13 09:13:40 INFO [package_unlock] Package versions are being unlocked
2020-08-13 09:13:40 INFO [pre] Executing pre configure hooks
2020-08-13 09:13:40 WARN [configure] Stage[main]/Foreman_proxy::Module::Logs/Foreman_proxy::Module[logs]/Foreman_proxy::Feature[Lo
gs]/Datacat_fragment[foreman_proxy::enabled_features::Logs]: Skipping because of failed dependencies
2020-08-13 09:13:40 ERROR [configure] Puppet apply error
Option 2
Space separators between each data point
2020-08-13 | 09:13:38 | INFO | init | Warming up
2020-08-13 | 09:13:39 | INFO | boot | Executing boot hooks
2020-08-13 | 09:13:40 | INFO | package_unlock | Package versions are being unlocked
2020-08-13 | 09:13:40 | INFO | pre | Executing pre configure hooks
2020-08-13 | 09:13:40 | WARN | configure | Stage[main]/Foreman_proxy::Module::Logs/Foreman_proxy::Module[logs]/Foreman_proxy::Feature[Lo
gs]/Datacat_fragment[foreman_proxy::enabled_features::Logs]: Skipping because of failed dependencies
2020-08-13 | 09:13:40 | ERROR | configure | Puppet apply error
Option 3
Current format, drop brackets to only wrap stage
INFO 2020-08-13 09:13:38 [init] Warming up
INFO 2020-08-13 09:13:39 [boot] Executing boot hooks
INFO 2020-08-13 09:13:40 [package_unlock] Package versions are being unlocked
INFO 2020-08-13 09:13:40 [pre] Executing pre configure hooks
WARN 2020-08-13 09:13:40 [configure] Stage[main]/Foreman_proxy::Module::Logs/Foreman_proxy::Module[logs]/Foreman_proxy::Feature[Lo
gs]/Datacat_fragment[foreman_proxy::enabled_features::Logs]: Skipping because of failed dependencies
ERROR 2020-08-13 09:13:40 [configure] Puppet apply error