airflow-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] [airflow] ohadmata commented on a change in pull request #6998: [AIRFLOW-6404] - ANSI color support for WebUI logger
Date Mon, 13 Jan 2020 16:25:12 GMT
ohadmata commented on a change in pull request #6998: [AIRFLOW-6404] - ANSI color support for
WebUI logger
URL: https://github.com/apache/airflow/pull/6998#discussion_r365896143
 
 

 ##########
 File path: airflow/hooks/http_hook.py
 ##########
 @@ -142,8 +144,13 @@ def check_response(self, response):
         try:
             response.raise_for_status()
         except requests.exceptions.HTTPError:
-            self.log.error("HTTP error: %s", response.reason)
-            self.log.error(response.text)
+            # mark the exception if colored log is supported
+            if conf.getboolean('core', 'colored_ui_logs'):
+                self.log.error(Fore.WHITE + Back.RED + "HTTP error: %s", response.reason
+ Style.RESET_ALL)
+                self.log.error(Fore.WHITE + Back.RED + response.text + Style.RESET_ALL)
 
 Review comment:
   I don't understand. where is this color log formatter?

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

Mime
View raw message