bbovenzi commented on code in PR #39006:
URL: https://github.com/apache/airflow/pull/39006#discussion_r1567452482


##########
airflow/www/static/js/utils/index.ts:
##########
@@ -185,6 +185,34 @@ const toSentenceCase = (camelCase: string): string => {
   return "";
 };
 
+const addColorKeyword = (
+  parsedLine: string,
+  errorKeywords: string[],
+  warningKeywords: string[]
+): string => {
+  const lowerParsedLine = parsedLine.toLowerCase();
+  const containsError = errorKeywords.some((keyword) =>
+    lowerParsedLine.includes(keyword)
+  );
+  const bold = (line: string) => `\x1b[1m${line}\x1b[0m`;
+  const red = (line: string) => `\x1b[31m${line}\x1b[39m`;
+  const yellow = (line: string) => `\x1b[33m${line}\x1b[39m`;
+
+  if (containsError) {
+    return bold(red(parsedLine));
+  }
+
+  const containsWarning = warningKeywords.some((keyword) =>

Review Comment:
   Do you mind rearranging these variables a little bit? It was hard to read at 
first. Let's keep the containsWarning and containsError declarations near each 
other.



-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to