mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-18 10:31:15 +00:00
refactor(core): Make Logger a service (no-changelog) (#7494)
This commit is contained in:
committed by
GitHub
parent
db4e61ba24
commit
05586a900d
@@ -1,9 +1,10 @@
|
||||
import { Service } from 'typedi';
|
||||
import type { ICredentialDataDecryptedObject } from 'n8n-workflow';
|
||||
import { deepCopy, LoggerProxy as Logger, jsonParse } from 'n8n-workflow';
|
||||
import { deepCopy, jsonParse } from 'n8n-workflow';
|
||||
import config from '@/config';
|
||||
import type { ICredentialsOverwrite } from '@/Interfaces';
|
||||
import { CredentialTypes } from '@/CredentialTypes';
|
||||
import { Logger } from '@/Logger';
|
||||
|
||||
@Service()
|
||||
export class CredentialsOverwrites {
|
||||
@@ -11,7 +12,10 @@ export class CredentialsOverwrites {
|
||||
|
||||
private resolvedTypes: string[] = [];
|
||||
|
||||
constructor(private credentialTypes: CredentialTypes) {
|
||||
constructor(
|
||||
private readonly credentialTypes: CredentialTypes,
|
||||
private readonly logger: Logger,
|
||||
) {
|
||||
const data = config.getEnv('credentials.overwrite.data');
|
||||
const overwriteData = jsonParse<ICredentialsOverwrite>(data, {
|
||||
errorMessage: 'The credentials-overwrite is not valid JSON.',
|
||||
@@ -61,7 +65,7 @@ export class CredentialsOverwrites {
|
||||
}
|
||||
|
||||
if (!this.credentialTypes.recognizes(type)) {
|
||||
Logger.warn(`Unknown credential type ${type} in Credential overwrites`);
|
||||
this.logger.warn(`Unknown credential type ${type} in Credential overwrites`);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user