feat: add logger

This commit is contained in:
divocat
2025-10-18 22:15:43 +03:00
parent 7ab0384e0b
commit f6e347af78
12 changed files with 298 additions and 130 deletions

View File

@@ -1,3 +1,5 @@
import { logger } from '../podkop';
export async function withTimeout<T>(
promise: Promise<T>,
timeoutMs: number,
@@ -16,6 +18,6 @@ export async function withTimeout<T>(
} finally {
clearTimeout(timeoutId);
const elapsed = performance.now() - start;
console.log(`[${operationName}] Execution time: ${elapsed.toFixed(2)} ms`);
logger.info('[SHELL]', `[${operationName}] took ${elapsed.toFixed(2)} ms`);
}
}