Skip to content

Commit

Permalink
Support formatting multiple performance hints in a single summary
Browse files Browse the repository at this point in the history
  • Loading branch information
ecooper committed Dec 10, 2024
1 parent cf87957 commit bcccef5
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/lib/fauna-client.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -145,8 +145,13 @@ export const formatPerformanceHint = (performanceHint) => {
}

try {
const [message, ...hints] = performanceHint.split("\n");
return `${message}\n${colorize(hints.join("\n"), { format: Format.FQL })}`;
const lines = performanceHint.split("\n").map((line) => {
if (line.startsWith("performance_hint")) {
return line;
}
return colorize(line, { format: Format.FQL });
});
return lines.join("\n");
} catch (err) {
const logger = container.resolve("logger");
logger.debug(`Unable to parse performance hint: ${err}`);
Expand Down

0 comments on commit bcccef5

Please sign in to comment.