Implement log level
There are no log files within a container environment and everything is directed to either stdin or stdout. This can be achieved via --verbose.
The --verbose flag generates too many irrelevant logs specifically problematic if an external log provider (e.g. Sumologic, loggly) is used. This leads to increased cost for no apparent reason.
A log level should be implemented to reduce the logs to a minimum, e.g. debug, info, warning, error, etc.
Message processing details such as p.log.Info("Processing message...") should be moved to debug level.
I have started working on a new major version. For this new version, I have planned to refactor logging completely. This includes:
- Leveled logging allowing the user to see more or less details as preferred.
- Fielded logging allowing the get additional details besides the message itself.
- Structured output (logfmt, json) allowing for easy post processing of the logs (helpful with ELK/EFK/Splunk)