tirkarthi commented on code in PR #39006:
URL: https://github.com/apache/airflow/pull/39006#discussion_r1572643904
##########
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`;
Review Comment:
Thanks, it helped performance to go from 15ms to 2ms. I tried inlining by
formatting and returning the string itself but for some reason the time went
back to 15ms though it was my assumption inlining the code would increase
performance which didn't happen on directly returning the string.
--
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]