MCPcopy
hub / github.com/coder/mux / buildServerCrashLogEntry

Function buildServerCrashLogEntry

src/cli/serverCrashLogging.ts:73–89  ·  view source on GitHub ↗
(options: ServerCrashLogOptions)

Source from the content-addressed store, hash-verified

71}
72
73export function buildServerCrashLogEntry(options: ServerCrashLogOptions): string {
74 const lines = [
75 `${(options.timestamp ?? new Date()).toISOString()} [mux server crash] ${options.event}`,
76 `pid=${options.pid ?? process.pid} cwd=${options.cwd ?? process.cwd()}`,
77 `argv=${JSON.stringify(redactServerArgvForLogs(options.argv ?? process.argv))}`,
78 ];
79
80 if (options.context && Object.keys(options.context).length > 0) {
81 lines.push(`context=${formatCrashDetail(options.context)}`);
82 }
83
84 if (options.detail !== undefined) {
85 lines.push(formatCrashDetail(options.detail));
86 }
87
88 return `${lines.join("\n")}\n`;
89}
90
91export function appendServerCrashLogSync(options: ServerCrashLogOptions): string {
92 let entry: string;

Callers 2

appendServerCrashLogSyncFunction · 0.85

Calls 3

redactServerArgvForLogsFunction · 0.85
formatCrashDetailFunction · 0.85
pushMethod · 0.65

Tested by

no test coverage detected