MCPcopy Index your code
hub / github.com/Waishnav/devspace / formatPretty

Function formatPretty

src/logger.ts:84–94  ·  view source on GitHub ↗
(entry: LogFields)

Source from the content-addressed store, hash-verified

82}
83
84function formatPretty(entry: LogFields): string {
85 const ts = String(entry.ts);
86 const level = String(entry.level).toUpperCase();
87 const event = String(entry.event);
88 const rest = Object.entries(entry)
89 .filter(([key, value]) => !["ts", "level", "event"].includes(key) && value !== undefined)
90 .map(([key, value]) => `${key}=${formatPrettyValue(value)}`)
91 .join(" ");
92
93 return rest ? `${ts} ${level} ${event} ${rest}` : `${ts} ${level} ${event}`;
94}
95
96function formatPrettyValue(value: unknown): string {
97 if (typeof value === "string") return JSON.stringify(value);

Callers 1

logEventFunction · 0.85

Calls 1

formatPrettyValueFunction · 0.85

Tested by

no test coverage detected