refactor(core): Convert verbose to debug logs (#10574)

This commit is contained in:
Iván Ovejero 2024-08-28 09:32:53 +02:00 committed by GitHub
parent ab9835126e
commit bc958be93b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
54 changed files with 68 additions and 74 deletions

View file

@ -19,7 +19,7 @@ export async function conversationalAgentExecute(
this: IExecuteFunctions,
nodeVersion: number,
): Promise<INodeExecutionData[][]> {
this.logger.verbose('Executing Conversational Agent');
this.logger.debug('Executing Conversational Agent');
const model = await this.getInputConnectionData(NodeConnectionType.AiLanguageModel, 0);
if (!isChatInstance(model)) {

View file

@ -23,7 +23,7 @@ export async function openAiFunctionsAgentExecute(
this: IExecuteFunctions,
nodeVersion: number,
): Promise<INodeExecutionData[][]> {
this.logger.verbose('Executing OpenAi Functions Agent');
this.logger.debug('Executing OpenAi Functions Agent');
const model = (await this.getInputConnectionData(
NodeConnectionType.AiLanguageModel,
0,

View file

@ -22,7 +22,7 @@ export async function planAndExecuteAgentExecute(
this: IExecuteFunctions,
nodeVersion: number,
): Promise<INodeExecutionData[][]> {
this.logger.verbose('Executing PlanAndExecute Agent');
this.logger.debug('Executing PlanAndExecute Agent');
const model = (await this.getInputConnectionData(
NodeConnectionType.AiLanguageModel,
0,

View file

@ -24,7 +24,7 @@ export async function reActAgentAgentExecute(
this: IExecuteFunctions,
nodeVersion: number,
): Promise<INodeExecutionData[][]> {
this.logger.verbose('Executing ReAct Agent');
this.logger.debug('Executing ReAct Agent');
const model = (await this.getInputConnectionData(NodeConnectionType.AiLanguageModel, 0)) as
| BaseLanguageModel

View file

@ -29,7 +29,7 @@ const parseTablesString = (tablesString: string) =>
export async function sqlAgentAgentExecute(
this: IExecuteFunctions,
): Promise<INodeExecutionData[][]> {
this.logger.verbose('Executing SQL Agent');
this.logger.debug('Executing SQL Agent');
const model = (await this.getInputConnectionData(
NodeConnectionType.AiLanguageModel,

View file

@ -76,7 +76,7 @@ async function extractBinaryMessages(ctx: IExecuteFunctions) {
}
export async function toolsAgentExecute(this: IExecuteFunctions): Promise<INodeExecutionData[][]> {
this.logger.verbose('Executing Tools Agent');
this.logger.debug('Executing Tools Agent');
const model = await this.getInputConnectionData(NodeConnectionType.AiLanguageModel, 0);
if (!isChatInstance(model) || !model.bindTools) {

View file

@ -517,7 +517,7 @@ export class ChainLlm implements INodeType {
};
async execute(this: IExecuteFunctions): Promise<INodeExecutionData[][]> {
this.logger.verbose('Executing LLM Chain');
this.logger.debug('Executing LLM Chain');
const items = this.getInputData();
const returnData: INodeExecutionData[] = [];

View file

@ -141,7 +141,7 @@ export class ChainRetrievalQa implements INodeType {
};
async execute(this: IExecuteFunctions): Promise<INodeExecutionData[][]> {
this.logger.verbose('Executing Retrieval QA Chain');
this.logger.debug('Executing Retrieval QA Chain');
const model = (await this.getInputConnectionData(
NodeConnectionType.AiLanguageModel,

View file

@ -162,7 +162,7 @@ export class ChainSummarizationV1 implements INodeType {
}
async execute(this: IExecuteFunctions): Promise<INodeExecutionData[][]> {
this.logger.verbose('Executing Vector Store QA Chain');
this.logger.debug('Executing Vector Store QA Chain');
const type = this.getNodeParameter('type', 0) as 'map_reduce' | 'stuff' | 'refine';
const model = (await this.getInputConnectionData(

View file

@ -311,7 +311,7 @@ export class ChainSummarizationV2 implements INodeType {
}
async execute(this: IExecuteFunctions): Promise<INodeExecutionData[][]> {
this.logger.verbose('Executing Summarization Chain V2');
this.logger.debug('Executing Summarization Chain V2');
const operationMode = this.getNodeParameter('operationMode', 0, 'nodeInputJson') as
| 'nodeInputJson'
| 'nodeInputBinary'

View file

@ -178,7 +178,7 @@ export class DocumentBinaryInputLoader implements INodeType {
};
async supplyData(this: IExecuteFunctions): Promise<SupplyData> {
this.logger.verbose('Supply Data for Binary Input Loader');
this.logger.debug('Supply Data for Binary Input Loader');
const textSplitter = (await this.getInputConnectionData(
NodeConnectionType.AiTextSplitter,
0,

View file

@ -80,7 +80,7 @@ export class DocumentJsonInputLoader implements INodeType {
};
async supplyData(this: IExecuteFunctions): Promise<SupplyData> {
this.logger.verbose('Supply Data for JSON Input Loader');
this.logger.debug('Supply Data for JSON Input Loader');
const textSplitter = (await this.getInputConnectionData(
NodeConnectionType.AiTextSplitter,
0,

View file

@ -93,7 +93,7 @@ export class EmbeddingsAzureOpenAi implements INodeType {
};
async supplyData(this: IExecuteFunctions, itemIndex: number): Promise<SupplyData> {
this.logger.verbose('Supply data for embeddings');
this.logger.debug('Supply data for embeddings');
const credentials = await this.getCredentials<{
apiKey: string;
resourceName: string;

View file

@ -100,7 +100,7 @@ export class EmbeddingsCohere implements INodeType {
};
async supplyData(this: IExecuteFunctions, itemIndex: number): Promise<SupplyData> {
this.logger.verbose('Supply data for embeddings Cohere');
this.logger.debug('Supply data for embeddings Cohere');
const modelName = this.getNodeParameter('modelName', itemIndex, 'embed-english-v2.0') as string;
const credentials = await this.getCredentials<{ apiKey: string }>('cohereApi');
const embeddings = new CohereEmbeddings({

View file

@ -117,7 +117,7 @@ export class EmbeddingsGoogleGemini implements INodeType {
};
async supplyData(this: IExecuteFunctions, itemIndex: number): Promise<SupplyData> {
this.logger.verbose('Supply data for embeddings Google Gemini');
this.logger.debug('Supply data for embeddings Google Gemini');
const modelName = this.getNodeParameter(
'modelName',
itemIndex,

View file

@ -116,7 +116,7 @@ export class EmbeddingsGooglePalm implements INodeType {
};
async supplyData(this: IExecuteFunctions, itemIndex: number): Promise<SupplyData> {
this.logger.verbose('Supply data for embeddings Google PaLM');
this.logger.debug('Supply data for embeddings Google PaLM');
const modelName = this.getNodeParameter(
'modelName',
itemIndex,

View file

@ -82,7 +82,7 @@ export class EmbeddingsHuggingFaceInference implements INodeType {
};
async supplyData(this: IExecuteFunctions, itemIndex: number): Promise<SupplyData> {
this.logger.verbose('Supply data for embeddings HF Inference');
this.logger.debug('Supply data for embeddings HF Inference');
const model = this.getNodeParameter(
'modelName',
itemIndex,

View file

@ -45,7 +45,7 @@ export class EmbeddingsOllama implements INodeType {
};
async supplyData(this: IExecuteFunctions, itemIndex: number): Promise<SupplyData> {
this.logger.verbose('Supply data for embeddings Ollama');
this.logger.debug('Supply data for embeddings Ollama');
const modelName = this.getNodeParameter('model', itemIndex) as string;
const credentials = await this.getCredentials('ollamaApi');

View file

@ -171,7 +171,7 @@ export class EmbeddingsOpenAi implements INodeType {
};
async supplyData(this: IExecuteFunctions, itemIndex: number): Promise<SupplyData> {
this.logger.verbose('Supply data for embeddings');
this.logger.debug('Supply data for embeddings');
const credentials = await this.getCredentials('openAiApi');
const options = this.getNodeParameter('options', itemIndex, {}) as {

View file

@ -88,7 +88,7 @@ export class MemoryChatRetriever implements INodeType {
};
async execute(this: IExecuteFunctions): Promise<INodeExecutionData[][]> {
this.logger.verbose('Executing Chat Memory Retriever');
this.logger.debug('Executing Chat Memory Retriever');
const memory = (await this.getInputConnectionData(NodeConnectionType.AiMemory, 0)) as
| BaseChatMemory

View file

@ -64,7 +64,7 @@ export class RetrieverContextualCompression implements INodeType {
};
async supplyData(this: IExecuteFunctions, itemIndex: number): Promise<SupplyData> {
this.logger.verbose('Supplying data for Contextual Compression Retriever');
this.logger.debug('Supplying data for Contextual Compression Retriever');
const model = (await this.getInputConnectionData(
NodeConnectionType.AiLanguageModel,

View file

@ -83,7 +83,7 @@ export class RetrieverMultiQuery implements INodeType {
};
async supplyData(this: IExecuteFunctions, itemIndex: number): Promise<SupplyData> {
this.logger.verbose('Supplying data for MultiQuery Retriever');
this.logger.debug('Supplying data for MultiQuery Retriever');
const options = this.getNodeParameter('options', itemIndex, {}) as { queryCount?: number };

View file

@ -57,7 +57,7 @@ export class RetrieverVectorStore implements INodeType {
};
async supplyData(this: IExecuteFunctions, itemIndex: number): Promise<SupplyData> {
this.logger.verbose('Supplying data for Vector Store Retriever');
this.logger.debug('Supplying data for Vector Store Retriever');
const topK = this.getNodeParameter('topK', itemIndex, 4) as number;
const vectorStore = (await this.getInputConnectionData(

View file

@ -64,7 +64,7 @@ export class TextSplitterCharacterTextSplitter implements INodeType {
};
async supplyData(this: IExecuteFunctions, itemIndex: number): Promise<SupplyData> {
this.logger.verbose('Supply Data for Text Splitter');
this.logger.debug('Supply Data for Text Splitter');
const separator = this.getNodeParameter('separator', itemIndex) as string;
const chunkSize = this.getNodeParameter('chunkSize', itemIndex) as number;

View file

@ -95,7 +95,7 @@ export class TextSplitterRecursiveCharacterTextSplitter implements INodeType {
};
async supplyData(this: IExecuteFunctions, itemIndex: number): Promise<SupplyData> {
this.logger.verbose('Supply Data for Text Splitter');
this.logger.debug('Supply Data for Text Splitter');
const chunkSize = this.getNodeParameter('chunkSize', itemIndex) as number;
const chunkOverlap = this.getNodeParameter('chunkOverlap', itemIndex) as number;

View file

@ -57,7 +57,7 @@ export class TextSplitterTokenSplitter implements INodeType {
};
async supplyData(this: IExecuteFunctions, itemIndex: number): Promise<SupplyData> {
this.logger.verbose('Supply Data for Text Splitter');
this.logger.debug('Supply Data for Text Splitter');
const chunkSize = this.getNodeParameter('chunkSize', itemIndex) as number;
const chunkOverlap = this.getNodeParameter('chunkOverlap', itemIndex) as number;

View file

@ -97,7 +97,7 @@ export class VectorStorePineconeInsert implements INodeType {
async execute(this: IExecuteFunctions): Promise<INodeExecutionData[][]> {
const items = this.getInputData(0);
this.logger.verbose('Executing data for Pinecone Insert Vector Store');
this.logger.debug('Executing data for Pinecone Insert Vector Store');
const namespace = this.getNodeParameter('pineconeNamespace', 0) as string;
const index = this.getNodeParameter('pineconeIndex', 0, '', { extractValue: true }) as string;

View file

@ -85,7 +85,7 @@ export class VectorStorePineconeLoad implements INodeType {
};
async supplyData(this: IExecuteFunctions, itemIndex: number): Promise<SupplyData> {
this.logger.verbose('Supplying data for Pinecone Load Vector Store');
this.logger.debug('Supplying data for Pinecone Load Vector Store');
const namespace = this.getNodeParameter('pineconeNamespace', itemIndex) as string;
const index = this.getNodeParameter('pineconeIndex', itemIndex, '', {

View file

@ -94,7 +94,7 @@ export class VectorStoreSupabaseInsert implements INodeType {
methods = { listSearch: { supabaseTableNameSearch } };
async execute(this: IExecuteFunctions): Promise<INodeExecutionData[][]> {
this.logger.verbose('Executing data for Supabase Insert Vector Store');
this.logger.debug('Executing data for Supabase Insert Vector Store');
const items = this.getInputData(0);
const tableName = this.getNodeParameter('tableName', 0, '', { extractValue: true }) as string;

View file

@ -82,7 +82,7 @@ export class VectorStoreSupabaseLoad implements INodeType {
methods = { listSearch: { supabaseTableNameSearch } };
async supplyData(this: IExecuteFunctions, itemIndex: number): Promise<SupplyData> {
this.logger.verbose('Supply Supabase Load Vector Store');
this.logger.debug('Supply Supabase Load Vector Store');
const tableName = this.getNodeParameter('tableName', itemIndex, '', {
extractValue: true,

View file

@ -101,7 +101,7 @@ export class VectorStoreZepInsert implements INodeType {
};
async execute(this: IExecuteFunctions): Promise<INodeExecutionData[][]> {
this.logger.verbose('Executing data for Zep Insert Vector Store');
this.logger.debug('Executing data for Zep Insert Vector Store');
const items = this.getInputData(0);
const collectionName = this.getNodeParameter('collectionName', 0) as string;
const options =

View file

@ -84,7 +84,7 @@ export class VectorStoreZepLoad implements INodeType {
};
async supplyData(this: IExecuteFunctions, itemIndex: number): Promise<SupplyData> {
this.logger.verbose('Supplying data for Zep Load Vector Store');
this.logger.debug('Supplying data for Zep Load Vector Store');
const collectionName = this.getNodeParameter('collectionName', itemIndex) as string;

View file

@ -95,7 +95,7 @@ export class ActiveWorkflowManager {
*/
async removeAll() {
let activeWorkflowIds: string[] = [];
this.logger.verbose('Call to remove all active workflows received (removeAll)');
this.logger.debug('Call to remove all active workflows received (removeAll)');
activeWorkflowIds.push(...this.activeWorkflows.allActiveWorkflows());
@ -437,7 +437,7 @@ export class ActiveWorkflowManager {
});
if (wasActivated) {
this.logger.verbose(`Successfully started workflow ${dbWorkflow.display()}`, {
this.logger.debug(`Successfully started workflow ${dbWorkflow.display()}`, {
workflowName: dbWorkflow.name,
workflowId: dbWorkflow.id,
});
@ -469,7 +469,7 @@ export class ActiveWorkflowManager {
}
}
this.logger.verbose('Finished activating workflows (startup)');
this.logger.debug('Finished activating workflows (startup)');
}
async clearAllActivationErrors() {
@ -800,7 +800,7 @@ export class ActiveWorkflowManager {
getPollFunctions,
);
this.logger.verbose(`Workflow ${dbWorkflow.display()} activated`, {
this.logger.debug(`Workflow ${dbWorkflow.display()} activated`, {
workflowId: dbWorkflow.id,
workflowName: dbWorkflow.name,
});

View file

@ -90,7 +90,7 @@ export class OAuth1CredentialController extends AbstractOAuthController {
decryptedDataOriginal.csrfSecret = csrfSecret;
await this.encryptAndSaveData(credential, decryptedDataOriginal);
this.logger.verbose('OAuth1 authorization successful for new credential', {
this.logger.debug('OAuth1 authorization successful for new credential', {
userId: req.user.id,
credentialId: credential.id,
});
@ -170,7 +170,7 @@ export class OAuth1CredentialController extends AbstractOAuthController {
await this.encryptAndSaveData(credential, decryptedDataOriginal);
this.logger.verbose('OAuth1 callback successful for new credential', {
this.logger.debug('OAuth1 callback successful for new credential', {
credentialId,
});
return res.render('oauth-callback');

View file

@ -71,7 +71,7 @@ export class OAuth2CredentialController extends AbstractOAuthController {
const oAuthObj = new ClientOAuth2(oAuthOptions);
const returnUri = oAuthObj.code.getUri();
this.logger.verbose('OAuth2 authorization url created for credential', {
this.logger.debug('OAuth2 authorization url created for credential', {
userId: req.user.id,
credentialId: credential.id,
});
@ -172,7 +172,7 @@ export class OAuth2CredentialController extends AbstractOAuthController {
delete decryptedDataOriginal.csrfSecret;
await this.encryptAndSaveData(credential, decryptedDataOriginal);
this.logger.verbose('OAuth2 callback successful for credential', {
this.logger.debug('OAuth2 callback successful for credential', {
credentialId,
});

View file

@ -40,7 +40,7 @@ export class WorkflowStatisticsController {
if (workflow) {
next();
} else {
this.logger.verbose('User attempted to read a workflow without permissions', {
this.logger.warn('User attempted to read a workflow without permissions', {
workflowId,
userId: user.id,
});

View file

@ -218,7 +218,7 @@ export class CredentialsController {
// Remove the encrypted data as it is not needed in the frontend
const { data: _, ...rest } = responseData;
this.logger.verbose('Credential updated', { credentialId });
this.logger.debug('Credential updated', { credentialId });
this.eventService.emit('credentials-updated', {
user: req.user,

View file

@ -388,7 +388,7 @@ export class CredentialsService {
return savedCredential;
});
this.logger.verbose('New credential created', {
this.logger.debug('New credential created', {
credentialId: newCredential.id,
ownerId: user.id,
});

View file

@ -36,7 +36,7 @@ export class Logger {
if (output.includes('console')) {
let format: winston.Logform.Format;
if (['debug', 'verbose'].includes(level)) {
if (level === 'debug') {
format = winston.format.combine(
winston.format.metadata(),
winston.format.timestamp(),
@ -115,8 +115,4 @@ export class Logger {
debug(message: string, meta: object = {}): void {
this.log('debug', message, meta);
}
verbose(message: string, meta: object = {}): void {
this.log('verbose', message, meta);
}
}

View file

@ -41,7 +41,7 @@ export class ActiveWorkflowsService {
'workflow:read',
]);
if (!workflow) {
this.logger.verbose('User attempted to access workflow errors without permissions', {
this.logger.warn('User attempted to access workflow errors without permissions', {
workflowId,
userId: user.id,
});

View file

@ -90,7 +90,7 @@ export class WorkflowStatisticsService extends TypedEmitter<WorkflowStatisticsEv
}
}
} catch (error) {
this.logger.verbose('Unable to fire first workflow success telemetry event');
this.logger.debug('Unable to fire first workflow success telemetry event');
}
}

View file

@ -52,7 +52,7 @@ export class NodeMailer {
text: mailData.textOnly,
html: mailData.body,
});
this.logger.verbose(
this.logger.debug(
`Email sent successfully to the following recipients: ${mailData.emailRecipients.toString()}`,
);
} catch (error) {

View file

@ -504,7 +504,7 @@ export async function executeWebhook(
responsePromise,
);
Container.get(Logger).verbose(
Container.get(Logger).debug(
`Started execution of workflow "${workflow.name}" from webhook with execution ID ${executionId}`,
{ executionId },
);

View file

@ -180,7 +180,7 @@ export function executeErrorWorkflow(
// To avoid an infinite loop do not run the error workflow again if the error-workflow itself failed and it is its own error-workflow.
const { errorWorkflow } = workflowData.settings ?? {};
if (errorWorkflow && !(mode === 'error' && workflowId && errorWorkflow === workflowId)) {
logger.verbose('Start external error workflow', {
logger.debug('Start external error workflow', {
executionId,
errorWorkflowId: errorWorkflow,
workflowId,
@ -222,7 +222,7 @@ export function executeErrorWorkflow(
workflowId !== undefined &&
workflowData.nodes.some((node) => node.type === errorTriggerType)
) {
logger.verbose('Start internal error workflow', { executionId, workflowId });
logger.debug('Start internal error workflow', { executionId, workflowId });
void Container.get(OwnershipService)
.getWorkflowProjectCached(workflowId)
.then((project) => {

View file

@ -238,7 +238,7 @@ export class WorkflowRunner {
additionalData.executionId = executionId;
this.logger.verbose(
this.logger.debug(
`Execution for workflow ${data.workflowData.name} was assigned id ${executionId}`,
{ executionId },
);

View file

@ -194,7 +194,7 @@ export class EnterpriseWorkflowService {
nodesWithCredentialsUserDoesNotHaveAccessTo.forEach((node) => {
if (isTamperingAttempt(node.id)) {
this.logger.verbose('Blocked workflow update due to tampering attempt', {
this.logger.warn('Blocked workflow update due to tampering attempt', {
nodeType: node.type,
nodeName: node.name,
nodeId: node.id,

View file

@ -96,7 +96,7 @@ export class WorkflowService {
]);
if (!workflow) {
this.logger.verbose('User attempted to update a workflow without permissions', {
this.logger.warn('User attempted to update a workflow without permissions', {
workflowId,
userId: user.id,
});
@ -120,7 +120,7 @@ export class WorkflowService {
// Update the workflow's version when changing properties such as
// `name`, `pinData`, `nodes`, `connections`, `settings` or `tags`
workflowUpdateData.versionId = uuid();
this.logger.verbose(
this.logger.debug(
`Updating versionId for workflow ${workflowId} for user ${user.id} after saving`,
{
previousVersionId: workflow.versionId,

View file

@ -309,7 +309,7 @@ export class WorkflowsController {
);
if (!workflow) {
this.logger.verbose('User attempted to access a workflow without permissions', {
this.logger.warn('User attempted to access a workflow without permissions', {
workflowId,
userId: req.user.id,
});
@ -362,7 +362,7 @@ export class WorkflowsController {
const workflow = await this.workflowService.delete(req.user, workflowId);
if (!workflow) {
this.logger.verbose('User attempted to delete a workflow without permissions', {
this.logger.warn('User attempted to delete a workflow without permissions', {
workflowId,
userId: req.user.id,
});

View file

@ -1954,7 +1954,7 @@ export function getAdditionalKeys(
if (mode === 'manual') {
throw e;
}
Logger.verbose(e.message);
Logger.debug(e.message);
}
},
setAll(obj: Record<string, string>): void {
@ -1964,7 +1964,7 @@ export function getAdditionalKeys(
if (mode === 'manual') {
throw e;
}
Logger.verbose(e.message);
Logger.debug(e.message);
}
},
get(key: string): string {

View file

@ -794,7 +794,7 @@ export class WorkflowExecute {
// active executions anymore
// eslint-disable-next-line @typescript-eslint/promise-function-async
processRunExecutionData(workflow: Workflow): PCancelable<IRun> {
Logger.verbose('Workflow execution started', { workflowId: workflow.id });
Logger.debug('Workflow execution started', { workflowId: workflow.id });
const startedAt = new Date();
const forceInputNodeExecution = this.forceInputNodeExecution(workflow);
@ -1804,7 +1804,7 @@ export class WorkflowExecute {
const fullRunData = this.getFullRunData(startedAt);
if (executionError !== undefined) {
Logger.verbose('Workflow execution finished with error', {
Logger.debug('Workflow execution finished with error', {
error: executionError,
workflowId: workflow.id,
});
@ -1818,13 +1818,13 @@ export class WorkflowExecute {
}
} else if (this.runExecutionData.waitTill!) {
// eslint-disable-next-line @typescript-eslint/restrict-template-expressions
Logger.verbose(`Workflow execution will wait until ${this.runExecutionData.waitTill}`, {
Logger.debug(`Workflow execution will wait until ${this.runExecutionData.waitTill}`, {
workflowId: workflow.id,
});
fullRunData.waitTill = this.runExecutionData.waitTill;
fullRunData.status = 'waiting';
} else {
Logger.verbose('Workflow execution finished successfully', { workflowId: workflow.id });
Logger.debug('Workflow execution finished successfully', { workflowId: workflow.id });
fullRunData.finished = true;
fullRunData.status = 'success';
}

View file

@ -589,7 +589,7 @@ export class EmailReadImapV1 implements INodeType {
conn.on('error', async (error) => {
const errorCode = error.code.toUpperCase();
if (['ECONNRESET', 'EPIPE'].includes(errorCode as string)) {
this.logger.verbose(`IMAP connection was reset (${errorCode}) - reconnecting.`, {
this.logger.debug(`IMAP connection was reset (${errorCode}) - reconnecting.`, {
error,
});
try {
@ -618,7 +618,7 @@ export class EmailReadImapV1 implements INodeType {
if (options.forceReconnect !== undefined) {
reconnectionInterval = setInterval(
async () => {
this.logger.verbose('Forcing reconnection of IMAP node.');
this.logger.debug('Forcing reconnection of IMAP node.');
connection.end();
connection = await establishConnection();
await connection.openBox(mailbox);

View file

@ -598,7 +598,7 @@ export class EmailReadImapV2 implements INodeType {
}
},
onUpdate: async (seqNo: number, info) => {
this.logger.verbose(`Email Read Imap:update ${seqNo}`, info);
this.logger.debug(`Email Read Imap:update ${seqNo}`, info);
},
};
@ -631,7 +631,7 @@ export class EmailReadImapV2 implements INodeType {
});
conn.on('error', async (error) => {
const errorCode = ((error as JsonObject).code as string).toUpperCase();
this.logger.verbose(`IMAP connection experienced an error: (${errorCode})`, {
this.logger.debug(`IMAP connection experienced an error: (${errorCode})`, {
error: error as Error,
});
this.emitError(error as Error);
@ -647,7 +647,7 @@ export class EmailReadImapV2 implements INodeType {
let reconnectionInterval: NodeJS.Timeout | undefined;
const handleReconnect = async () => {
this.logger.verbose('Forcing reconnect to IMAP server');
this.logger.debug('Forcing reconnect to IMAP server');
try {
isCurrentlyReconnecting = true;
if (connection.closeBox) await connection.closeBox(false);

View file

@ -8,7 +8,7 @@ export const ALPHABET = [DIGITS, UPPERCASE_LETTERS, LOWERCASE_LETTERS].join('');
export const BINARY_ENCODING = 'base64';
export const WAIT_TIME_UNLIMITED = '3000-01-01T00:00:00.000Z';
export const LOG_LEVELS = ['silent', 'error', 'warn', 'info', 'debug', 'verbose'] as const;
export const LOG_LEVELS = ['silent', 'error', 'warn', 'info', 'debug'] as const;
export const CODE_LANGUAGES = ['javaScript', 'python'] as const;
export const CODE_EXECUTION_MODES = ['runOnceForAllItems', 'runOnceForEachItem'] as const;

View file

@ -5,12 +5,10 @@ export let error: Logger['error'] = noOp;
export let warn: Logger['warn'] = noOp;
export let info: Logger['info'] = noOp;
export let debug: Logger['debug'] = noOp;
export let verbose: Logger['verbose'] = noOp;
export const init = (logger: Logger) => {
error = (message, meta) => logger.error(message, meta);
warn = (message, meta) => logger.warn(message, meta);
info = (message, meta) => logger.info(message, meta);
debug = (message, meta) => logger.debug(message, meta);
verbose = (message, meta) => logger.verbose(message, meta);
};