python.d: respect env NETDATA_LOG_SEVERITY_LEVEL (#16084)
* python.d: respect env NETDATA_LOG_SEVERITY_LEVEL * lower
Ilya Mashchenko committed
Oct 2, 2023 at 20:15 UTC
6ae0a7e71c532b62ac4ab6a31051f35c5b7ff19f
1 file changed
+11
collectors/python.d.plugin/python.d.plugin.in
+11
@@ -876,6 +876,17 @@ def main():
876
cmd = parse_command_line()
877
log = PythonDLogger()
878
879
+ level = os.getenv('NETDATA_LOG_SEVERITY_LEVEL') or str()
880
+ level = level.lower()
881
+ if level == 'debug':
882
+ log.logger.severity = 'DEBUG'
883
+ elif level == 'info':
884
+ log.logger.severity = 'INFO'
885
+ elif level == 'warn' or level == 'warning':
886
+ log.logger.severity = 'WARNING'
887
+ elif level == 'err' or level == 'error':
888
+ log.logger.severity = 'ERROR'
889
+
890
if cmd.debug:
891
log.logger.severity = 'DEBUG'
892
if cmd.trace: