Automattic / vip-go-ci

Continuous integration for VIP Go repositories
Other
51 stars 23 forks source link

Introducing log levels in vipgoci_log() #329

Open gudmdharalds opened 2 years ago

gudmdharalds commented 2 years ago

Feature request

With higher complexity of vip-go-ci and use cases as a library, too much information is logged in some cases, while in others it is optimal, and so a threshold needs to be configurable at run-time. See example of this here.

To resolve this, each log message should an associated log level. The levels would be: INFO, DEBUG and ERROR. ERROR would always be printed, but whether to print INFO and DEBUG messages would be configurable on the command line. This means that different use cases can make use of different log levels:

Background of feature request

Logging has become too noisy in some use-cases, while in others it is fine. We need to be able to configure log levels easily.

Description of feature

vipgoci_log() needs to be altered, replacing the $debug_level parameter with $log_level which uses predefined constants. All calls to vipgoci_log() will need to be updated.

Supersedes #193.