refactor(core): Make Logger a service (no-changelog) (#7494)

This commit is contained in:
कारतोफ्फेलस्क्रिप्ट™
2023-10-25 16:35:22 +02:00
committed by GitHub
parent db4e61ba24
commit 05586a900d
131 changed files with 761 additions and 919 deletions

View File

@@ -3,8 +3,9 @@ import { mkdir, utimes, open, rm } from 'fs/promises';
import { join, dirname } from 'path';
import { Container } from 'typedi';
import { InstanceSettings } from 'n8n-core';
import { LoggerProxy, sleep } from 'n8n-workflow';
import { sleep } from 'n8n-workflow';
import { inProduction } from '@/constants';
import { Logger } from '@/Logger';
export const touchFile = async (filePath: string): Promise<void> => {
await mkdir(dirname(filePath), { recursive: true });
@@ -25,7 +26,7 @@ export const init = async () => {
if (existsSync(journalFile)) {
// Crash detected
LoggerProxy.error('Last session crashed');
Container.get(Logger).error('Last session crashed');
// add a 10 seconds pause to slow down crash-looping
await sleep(10_000);
}