Skip to content

Commit

Permalink
fix(console): trim log messages (#6952)
Browse files Browse the repository at this point in the history
Some log messages end with a new line, so the console logs are presented
with an expand chevron which does nothing but showing an additional
empty line.

Trimming log messages fixes this issue.
  • Loading branch information
skyrpex authored Jul 26, 2024
1 parent c901bf6 commit 2b18e76
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion apps/wing-console/console/server/src/router/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import type { ResourceRunningState } from "@winglang/sdk/lib/simulator/simulator
import uniqby from "lodash.uniqby";
import { z } from "zod";

import type { LogEntry } from "../consoleLogger.js";
import type { Trace } from "../types.js";
import type { ConstructTreeNode } from "../utils/construct-tree.js";
import type {
Expand Down Expand Up @@ -150,7 +151,13 @@ export const createAppRouter = () => {
});

return {
logs: filteredLogs,
logs: filteredLogs.map(
(entry) =>
({
...entry,
message: entry.message.trim(),
} as LogEntry),
),
hiddenLogs: noVerboseLogsCount - filteredLogs.length,
};
}),
Expand Down

0 comments on commit 2b18e76

Please sign in to comment.