#979 Use the LOG_LEVEL config value to set the default level for the APP.logger and StreamHandler
Merged 8 years ago by pingou. Opened 8 years ago by nmfm.
nmfm/pagure log_level_config  into  master

file modified
+2 -1
@@ -144,10 +144,11 @@ 

  

  # Send classic logs into syslog

  SHANDLER = logging.StreamHandler()

- SHANDLER.setLevel(APP.config.get('log_level', 'INFO'))

+ SHANDLER.setLevel(APP.config.get('LOG_LEVEL', 'INFO'))

  APP.logger.addHandler(SHANDLER)

  

  LOG = APP.logger

+ LOG.setLevel(APP.config.get('LOG_LEVEL', 'INFO'))

  

  APP.wsgi_app = pagure.proxy.ReverseProxied(APP.wsgi_app)

  

Converting LOG_LEVEL to uppercase as Flask only reads keys in uppercase from the config file.

Also using it to set the level in APP.logger. I'm using 'INFO' as a default here as well, hope it's not a problem (in my machine, getEffectiveLevel() was returning WARNING when the level was not set directly in the logger).

Looks good to me, would you mind rebasing the PR on the top of the current master? I try to keep the history linear :)

rebased

8 years ago

Pull-Request has been merged by pingou

8 years ago
Metadata