Roll out consistent debug output in project
The docs-gitlab-com project has four sources that can produce debug output:
- Go code (which can be run like a script).
- Shell scripts.
- Makefiles.
- JavaScript code (we have scripts that are JavaScript code).
At the moment, debug output looks quite varied depending on where the message is coming from, which looks unpolished might lead to confusion as to whether or not this project is producing the message, or some other project.
As we continue to refine docs-gitlab-com project, it's good to standardize on what elements debug output should have (for example, timestamps) and to standardise the look and feel of debug output so that it's easy to identify in job logs etc. We should also document how to add new debug statements, because it's better to over communicate than under communicate.
Proposed solution
We could implement our own consistent debug loggers for each of the domains, but off-the-shell solutions exist and have been partially implemented already:
- Log (https://github.com/charmbracelet/log/blob/main/README.md), for Go code. Partially implemented: https://gitlab.com/gitlab-org/technical-writing/docs-gitlab-com/-/blob/709c8e30a62f1d5e46f252a620dcfbc40ea13e61/cmd/internal/logger/logger.go.
- Gum (https://github.com/charmbracelet/gum/blob/main/README.md), for:
- Shell scripts.
- Makefiles. Partially implemented: https://gitlab.com/gitlab-org/technical-writing/docs-gitlab-com/-/blob/709c8e30a62f1d5e46f252a620dcfbc40ea13e61/Makefile#L8
- Chalk (https://github.com/chalk/chalk/blob/main/readme.md), for Node.js scripts.
Off-the shelf solutions lowers the maintenance burden for the team at the expense of some additional complexity initially.
This issue is resolved when Log, Gum, and Chalk are fully rolled out and all debug output, regardless of of source, is standardized and documented.