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

@@ -1,7 +1,8 @@
import type { TEntitlement, TFeatures, TLicenseBlock } from '@n8n_io/license-sdk';
import { LicenseManager } from '@n8n_io/license-sdk';
import type { ILogger } from 'n8n-workflow';
import { getLogger } from './Logger';
import { InstanceSettings, ObjectStoreService } from 'n8n-core';
import Container, { Service } from 'typedi';
import { Logger } from '@/Logger';
import config from '@/config';
import * as Db from '@/Db';
import {
@@ -11,12 +12,10 @@ import {
SETTINGS_LICENSE_CERT_KEY,
UNLIMITED_LICENSE_QUOTA,
} from './constants';
import Container, { Service } from 'typedi';
import { WorkflowRepository } from '@/databases/repositories';
import type { BooleanLicenseFeature, N8nInstanceType, NumericLicenseFeature } from './Interfaces';
import type { RedisServicePubSubPublisher } from './services/redis/RedisServicePubSubPublisher';
import { RedisService } from './services/redis.service';
import { InstanceSettings, ObjectStoreService } from 'n8n-core';
type FeatureReturnType = Partial<
{
@@ -26,15 +25,14 @@ type FeatureReturnType = Partial<
@Service()
export class License {
private logger: ILogger;
private manager: LicenseManager | undefined;
private redisPublisher: RedisServicePubSubPublisher;
constructor(private readonly instanceSettings: InstanceSettings) {
this.logger = getLogger();
}
constructor(
private readonly logger: Logger,
private readonly instanceSettings: InstanceSettings,
) {}
async init(instanceType: N8nInstanceType = 'main') {
if (this.manager) {