MCPcopy Create free account
hub / github.com/api3dao/airnode / writeLog

Function writeLog

packages/airnode-deployer/src/utils/logger.ts:101–111  ·  view source on GitHub ↗
(text: string, options?: LoggerOptions)

Source from the content-addressed store, hash-verified

99}
100
101export function writeLog(text: string, options?: LoggerOptions) {
102 if (!logsDirectory) throw new Error('Missing log file directory.');
103
104 const safeText = options?.secrets ? replaceSecrets(text, secrets) : text;
105 // Strip ANSI characters to write tables to log files correctly and add new line
106 const sanitizedLogs = ANSI_REGEX.test(safeText) ? '\n' + safeText.replace(ANSI_REGEX, '') : safeText;
107 fs.appendFileSync(
108 path.join(logsDirectory, `deployer-${logFileTimestamp}.log`),
109 `${new Date().toISOString()}: ${sanitizedLogs}\n`
110 );
111}
112
113export function succeed(text: string, options?: LoggerOptions) {
114 writeLog(text, options);

Callers 13

startMethod · 0.85
succeedMethod · 0.85
failMethod · 0.85
infoMethod · 0.85
warnMethod · 0.85
stopMethod · 0.85
succeedFunction · 0.85
failFunction · 0.85
warnFunction · 0.85
infoFunction · 0.85
debugFunction · 0.85
debugSpinnerFunction · 0.85

Calls 1

replaceSecretsFunction · 0.85

Tested by

no test coverage detected