MCPcopy Create free account
hub / github.com/angular/dev-infra / appendToLogFile

Function appendToLogFile

ng-dev/utils/logging.ts:177–196  ·  view source on GitHub ↗

Write the provided text to the log file, prepending each line with the log level.

(logLevel: LogLevel | undefined, ...text: unknown[])

Source from the content-addressed store, hash-verified

175}
176
177/** Write the provided text to the log file, prepending each line with the log level. */
178function appendToLogFile(logLevel: LogLevel | undefined, ...text: unknown[]) {
179 if (logStream === undefined) {
180 return;
181 }
182 if (logLevel === undefined) {
183 logStream.write(text.join(' ') + '\n');
184 return;
185 }
186
187 const logLevelText = `${LogLevel[logLevel]}:`.padEnd(LOG_LEVEL_COLUMNS);
188 logStream.write(
189 stripVTControlCharacters(
190 text
191 .join(' ')
192 .split('\n')
193 .map((l) => `${logLevelText} ${l}\n`)
194 .join(''),
195 ),
196 );
197}

Callers 2

runConsoleCommandFunction · 0.85

Calls 1

writeMethod · 0.45

Tested by

no test coverage detected