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, this: IExecuteFunctions,
nodeVersion: number, nodeVersion: number,
): Promise<INodeExecutionData[][]> { ): Promise<INodeExecutionData[][]> {
this.logger.verbose('Executing Conversational Agent'); this.logger.debug('Executing Conversational Agent');
const model = await this.getInputConnectionData(NodeConnectionType.AiLanguageModel, 0); const model = await this.getInputConnectionData(NodeConnectionType.AiLanguageModel, 0);
if (!isChatInstance(model)) { if (!isChatInstance(model)) {

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -141,7 +141,7 @@ export class ChainRetrievalQa implements INodeType {
}; };
async execute(this: IExecuteFunctions): Promise<INodeExecutionData[][]> { 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( const model = (await this.getInputConnectionData(
NodeConnectionType.AiLanguageModel, NodeConnectionType.AiLanguageModel,

View file

@ -162,7 +162,7 @@ export class ChainSummarizationV1 implements INodeType {
} }
async execute(this: IExecuteFunctions): Promise<INodeExecutionData[][]> { 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 type = this.getNodeParameter('type', 0) as 'map_reduce' | 'stuff' | 'refine';
const model = (await this.getInputConnectionData( const model = (await this.getInputConnectionData(

View file

@ -311,7 +311,7 @@ export class ChainSummarizationV2 implements INodeType {
} }
async execute(this: IExecuteFunctions): Promise<INodeExecutionData[][]> { 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 const operationMode = this.getNodeParameter('operationMode', 0, 'nodeInputJson') as
| 'nodeInputJson' | 'nodeInputJson'
| 'nodeInputBinary' | 'nodeInputBinary'

View file

@ -178,7 +178,7 @@ export class DocumentBinaryInputLoader implements INodeType {
}; };
async supplyData(this: IExecuteFunctions): Promise<SupplyData> { 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( const textSplitter = (await this.getInputConnectionData(
NodeConnectionType.AiTextSplitter, NodeConnectionType.AiTextSplitter,
0, 0,

View file

@ -80,7 +80,7 @@ export class DocumentJsonInputLoader implements INodeType {
}; };
async supplyData(this: IExecuteFunctions): Promise<SupplyData> { 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( const textSplitter = (await this.getInputConnectionData(
NodeConnectionType.AiTextSplitter, NodeConnectionType.AiTextSplitter,
0, 0,

View file

@ -93,7 +93,7 @@ export class EmbeddingsAzureOpenAi implements INodeType {
}; };
async supplyData(this: IExecuteFunctions, itemIndex: number): Promise<SupplyData> { 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<{ const credentials = await this.getCredentials<{
apiKey: string; apiKey: string;
resourceName: string; resourceName: string;

View file

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

View file

@ -117,7 +117,7 @@ export class EmbeddingsGoogleGemini implements INodeType {
}; };
async supplyData(this: IExecuteFunctions, itemIndex: number): Promise<SupplyData> { 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( const modelName = this.getNodeParameter(
'modelName', 'modelName',
itemIndex, itemIndex,

View file

@ -116,7 +116,7 @@ export class EmbeddingsGooglePalm implements INodeType {
}; };
async supplyData(this: IExecuteFunctions, itemIndex: number): Promise<SupplyData> { 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( const modelName = this.getNodeParameter(
'modelName', 'modelName',
itemIndex, itemIndex,

View file

@ -82,7 +82,7 @@ export class EmbeddingsHuggingFaceInference implements INodeType {
}; };
async supplyData(this: IExecuteFunctions, itemIndex: number): Promise<SupplyData> { 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( const model = this.getNodeParameter(
'modelName', 'modelName',
itemIndex, itemIndex,

View file

@ -45,7 +45,7 @@ export class EmbeddingsOllama implements INodeType {
}; };
async supplyData(this: IExecuteFunctions, itemIndex: number): Promise<SupplyData> { 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 modelName = this.getNodeParameter('model', itemIndex) as string;
const credentials = await this.getCredentials('ollamaApi'); 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> { 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 credentials = await this.getCredentials('openAiApi');
const options = this.getNodeParameter('options', itemIndex, {}) as { const options = this.getNodeParameter('options', itemIndex, {}) as {

View file

@ -88,7 +88,7 @@ export class MemoryChatRetriever implements INodeType {
}; };
async execute(this: IExecuteFunctions): Promise<INodeExecutionData[][]> { 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 const memory = (await this.getInputConnectionData(NodeConnectionType.AiMemory, 0)) as
| BaseChatMemory | BaseChatMemory

View file

@ -64,7 +64,7 @@ export class RetrieverContextualCompression implements INodeType {
}; };
async supplyData(this: IExecuteFunctions, itemIndex: number): Promise<SupplyData> { 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( const model = (await this.getInputConnectionData(
NodeConnectionType.AiLanguageModel, NodeConnectionType.AiLanguageModel,

View file

@ -83,7 +83,7 @@ export class RetrieverMultiQuery implements INodeType {
}; };
async supplyData(this: IExecuteFunctions, itemIndex: number): Promise<SupplyData> { 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 }; 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> { 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 topK = this.getNodeParameter('topK', itemIndex, 4) as number;
const vectorStore = (await this.getInputConnectionData( const vectorStore = (await this.getInputConnectionData(

View file

@ -64,7 +64,7 @@ export class TextSplitterCharacterTextSplitter implements INodeType {
}; };
async supplyData(this: IExecuteFunctions, itemIndex: number): Promise<SupplyData> { 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 separator = this.getNodeParameter('separator', itemIndex) as string;
const chunkSize = this.getNodeParameter('chunkSize', itemIndex) as number; 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> { 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 chunkSize = this.getNodeParameter('chunkSize', itemIndex) as number;
const chunkOverlap = this.getNodeParameter('chunkOverlap', 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> { 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 chunkSize = this.getNodeParameter('chunkSize', itemIndex) as number;
const chunkOverlap = this.getNodeParameter('chunkOverlap', 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[][]> { async execute(this: IExecuteFunctions): Promise<INodeExecutionData[][]> {
const items = this.getInputData(0); 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 namespace = this.getNodeParameter('pineconeNamespace', 0) as string;
const index = this.getNodeParameter('pineconeIndex', 0, '', { extractValue: true }) 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> { 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 namespace = this.getNodeParameter('pineconeNamespace', itemIndex) as string;
const index = this.getNodeParameter('pineconeIndex', itemIndex, '', { const index = this.getNodeParameter('pineconeIndex', itemIndex, '', {

View file

@ -94,7 +94,7 @@ export class VectorStoreSupabaseInsert implements INodeType {
methods = { listSearch: { supabaseTableNameSearch } }; methods = { listSearch: { supabaseTableNameSearch } };
async execute(this: IExecuteFunctions): Promise<INodeExecutionData[][]> { 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 items = this.getInputData(0);
const tableName = this.getNodeParameter('tableName', 0, '', { extractValue: true }) as string; const tableName = this.getNodeParameter('tableName', 0, '', { extractValue: true }) as string;

View file

@ -82,7 +82,7 @@ export class VectorStoreSupabaseLoad implements INodeType {
methods = { listSearch: { supabaseTableNameSearch } }; methods = { listSearch: { supabaseTableNameSearch } };
async supplyData(this: IExecuteFunctions, itemIndex: number): Promise<SupplyData> { 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, '', { const tableName = this.getNodeParameter('tableName', itemIndex, '', {
extractValue: true, extractValue: true,

View file

@ -101,7 +101,7 @@ export class VectorStoreZepInsert implements INodeType {
}; };
async execute(this: IExecuteFunctions): Promise<INodeExecutionData[][]> { 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 items = this.getInputData(0);
const collectionName = this.getNodeParameter('collectionName', 0) as string; const collectionName = this.getNodeParameter('collectionName', 0) as string;
const options = const options =

View file

@ -84,7 +84,7 @@ export class VectorStoreZepLoad implements INodeType {
}; };
async supplyData(this: IExecuteFunctions, itemIndex: number): Promise<SupplyData> { 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; const collectionName = this.getNodeParameter('collectionName', itemIndex) as string;

View file

@ -95,7 +95,7 @@ export class ActiveWorkflowManager {
*/ */
async removeAll() { async removeAll() {
let activeWorkflowIds: string[] = []; 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()); activeWorkflowIds.push(...this.activeWorkflows.allActiveWorkflows());
@ -437,7 +437,7 @@ export class ActiveWorkflowManager {
}); });
if (wasActivated) { if (wasActivated) {
this.logger.verbose(`Successfully started workflow ${dbWorkflow.display()}`, { this.logger.debug(`Successfully started workflow ${dbWorkflow.display()}`, {
workflowName: dbWorkflow.name, workflowName: dbWorkflow.name,
workflowId: dbWorkflow.id, 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() { async clearAllActivationErrors() {
@ -800,7 +800,7 @@ export class ActiveWorkflowManager {
getPollFunctions, getPollFunctions,
); );
this.logger.verbose(`Workflow ${dbWorkflow.display()} activated`, { this.logger.debug(`Workflow ${dbWorkflow.display()} activated`, {
workflowId: dbWorkflow.id, workflowId: dbWorkflow.id,
workflowName: dbWorkflow.name, workflowName: dbWorkflow.name,
}); });

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -36,7 +36,7 @@ export class Logger {
if (output.includes('console')) { if (output.includes('console')) {
let format: winston.Logform.Format; let format: winston.Logform.Format;
if (['debug', 'verbose'].includes(level)) { if (level === 'debug') {
format = winston.format.combine( format = winston.format.combine(
winston.format.metadata(), winston.format.metadata(),
winston.format.timestamp(), winston.format.timestamp(),
@ -115,8 +115,4 @@ export class Logger {
debug(message: string, meta: object = {}): void { debug(message: string, meta: object = {}): void {
this.log('debug', message, meta); 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', 'workflow:read',
]); ]);
if (!workflow) { 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, workflowId,
userId: user.id, userId: user.id,
}); });

View file

@ -90,7 +90,7 @@ export class WorkflowStatisticsService extends TypedEmitter<WorkflowStatisticsEv
} }
} }
} catch (error) { } 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, text: mailData.textOnly,
html: mailData.body, html: mailData.body,
}); });
this.logger.verbose( this.logger.debug(
`Email sent successfully to the following recipients: ${mailData.emailRecipients.toString()}`, `Email sent successfully to the following recipients: ${mailData.emailRecipients.toString()}`,
); );
} catch (error) { } catch (error) {

View file

@ -504,7 +504,7 @@ export async function executeWebhook(
responsePromise, responsePromise,
); );
Container.get(Logger).verbose( Container.get(Logger).debug(
`Started execution of workflow "${workflow.name}" from webhook with execution ID ${executionId}`, `Started execution of workflow "${workflow.name}" from webhook with execution ID ${executionId}`,
{ 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. // 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 ?? {}; const { errorWorkflow } = workflowData.settings ?? {};
if (errorWorkflow && !(mode === 'error' && workflowId && errorWorkflow === workflowId)) { if (errorWorkflow && !(mode === 'error' && workflowId && errorWorkflow === workflowId)) {
logger.verbose('Start external error workflow', { logger.debug('Start external error workflow', {
executionId, executionId,
errorWorkflowId: errorWorkflow, errorWorkflowId: errorWorkflow,
workflowId, workflowId,
@ -222,7 +222,7 @@ export function executeErrorWorkflow(
workflowId !== undefined && workflowId !== undefined &&
workflowData.nodes.some((node) => node.type === errorTriggerType) 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) void Container.get(OwnershipService)
.getWorkflowProjectCached(workflowId) .getWorkflowProjectCached(workflowId)
.then((project) => { .then((project) => {

View file

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

View file

@ -194,7 +194,7 @@ export class EnterpriseWorkflowService {
nodesWithCredentialsUserDoesNotHaveAccessTo.forEach((node) => { nodesWithCredentialsUserDoesNotHaveAccessTo.forEach((node) => {
if (isTamperingAttempt(node.id)) { 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, nodeType: node.type,
nodeName: node.name, nodeName: node.name,
nodeId: node.id, nodeId: node.id,

View file

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

View file

@ -309,7 +309,7 @@ export class WorkflowsController {
); );
if (!workflow) { 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, workflowId,
userId: req.user.id, userId: req.user.id,
}); });
@ -362,7 +362,7 @@ export class WorkflowsController {
const workflow = await this.workflowService.delete(req.user, workflowId); const workflow = await this.workflowService.delete(req.user, workflowId);
if (!workflow) { 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, workflowId,
userId: req.user.id, userId: req.user.id,
}); });

View file

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

View file

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

View file

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

View file

@ -598,7 +598,7 @@ export class EmailReadImapV2 implements INodeType {
} }
}, },
onUpdate: async (seqNo: number, info) => { 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) => { conn.on('error', async (error) => {
const errorCode = ((error as JsonObject).code as string).toUpperCase(); 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, error: error as Error,
}); });
this.emitError(error as Error); this.emitError(error as Error);
@ -647,7 +647,7 @@ export class EmailReadImapV2 implements INodeType {
let reconnectionInterval: NodeJS.Timeout | undefined; let reconnectionInterval: NodeJS.Timeout | undefined;
const handleReconnect = async () => { const handleReconnect = async () => {
this.logger.verbose('Forcing reconnect to IMAP server'); this.logger.debug('Forcing reconnect to IMAP server');
try { try {
isCurrentlyReconnecting = true; isCurrentlyReconnecting = true;
if (connection.closeBox) await connection.closeBox(false); 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 BINARY_ENCODING = 'base64';
export const WAIT_TIME_UNLIMITED = '3000-01-01T00:00:00.000Z'; 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_LANGUAGES = ['javaScript', 'python'] as const;
export const CODE_EXECUTION_MODES = ['runOnceForAllItems', 'runOnceForEachItem'] 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 warn: Logger['warn'] = noOp;
export let info: Logger['info'] = noOp; export let info: Logger['info'] = noOp;
export let debug: Logger['debug'] = noOp; export let debug: Logger['debug'] = noOp;
export let verbose: Logger['verbose'] = noOp;
export const init = (logger: Logger) => { export const init = (logger: Logger) => {
error = (message, meta) => logger.error(message, meta); error = (message, meta) => logger.error(message, meta);
warn = (message, meta) => logger.warn(message, meta); warn = (message, meta) => logger.warn(message, meta);
info = (message, meta) => logger.info(message, meta); info = (message, meta) => logger.info(message, meta);
debug = (message, meta) => logger.debug(message, meta); debug = (message, meta) => logger.debug(message, meta);
verbose = (message, meta) => logger.verbose(message, meta);
}; };