MCPcopy Create free account
hub / github.com/agent-tower/core / writeErrorLog

Function writeErrorLog

packages/server/src/utils/error-log.ts:42–51  ·  view source on GitHub ↗
(entry: ErrorLogEntry, options: ErrorLogOptions = {})

Source from the content-addressed store, hash-verified

40}
41
42export function writeErrorLog(entry: ErrorLogEntry, options: ErrorLogOptions = {}): string | null {
43 try {
44 const logFile = getErrorLogFilePath(options.dataDir, options.fileName ?? DEFAULT_LOG_FILE);
45 mkdirSync(path.dirname(logFile), { recursive: true });
46 appendFileSync(logFile, `${formatErrorLogEntry(entry, options.now)}\n`, 'utf-8');
47 return logFile;
48 } catch {
49 return null;
50 }
51}
52
53export function installProcessErrorLogging(dataDir?: string): void {
54 if (processHandlersInstalled) return;

Callers 15

index.tsFile · 0.85
shutdownFunction · 0.85
mainFunction · 0.85
buildAppFunction · 0.85
ensureDatabaseFunction · 0.85
cli.tsFile · 0.85
error-log.test.tsFile · 0.85
spawnInternalFunction · 0.85
spawnWithStdinFunction · 0.85
constructorMethod · 0.85
startFollowUpMethod · 0.85

Calls 2

getErrorLogFilePathFunction · 0.85
formatErrorLogEntryFunction · 0.85

Tested by

no test coverage detected