(path: string, message: object)
| 109 | } |
| 110 | |
| 111 | function appendToLog(path: string, message: object): void { |
| 112 | if (process.env.USER_TYPE !== 'ant') { |
| 113 | return |
| 114 | } |
| 115 | |
| 116 | const messageWithTimestamp = { |
| 117 | timestamp: new Date().toISOString(), |
| 118 | ...message, |
| 119 | cwd: getFsImplementation().cwd(), |
| 120 | userType: process.env.USER_TYPE, |
| 121 | sessionId: getSessionId(), |
| 122 | version: MACRO.VERSION, |
| 123 | } |
| 124 | |
| 125 | getLogWriter(path).write(messageWithTimestamp) |
| 126 | } |
| 127 | |
| 128 | function extractServerMessage(data: unknown): string | undefined { |
| 129 | if (typeof data === 'string') { |
no test coverage detected