diff --git a/extension/src/client/command/RunAction.ts b/extension/src/client/command/RunAction.ts index 0973fc6d..79a1d59b 100644 --- a/extension/src/client/command/RunAction.ts +++ b/extension/src/client/command/RunAction.ts @@ -280,7 +280,6 @@ class ActionRunner { } this.logger.info(`Running workflow ${RUN_SCRIPT_WORKFLOW_ID} (vRO ${this.vroVersion})`) - const supportsSysLog = semver.gt(this.vroVersion, "7.3.1") const params = [ { name: "script", @@ -293,7 +292,7 @@ class ActionRunner { name: "printInOutput", type: "boolean", value: { - boolean: { value: !supportsSysLog } + boolean: { value: true } } } ] @@ -416,6 +415,9 @@ abstract class FetchSysLogsStrategy extends FetchLogsStrategy { protected abstract getLogMessages(): Promise async printMessages(): Promise { + if (Logger.level === "off") { + return + } const timestamp = Date.now() - 10000 // 10sec earlier const logs = await this.getLogMessages() logs.forEach(logMessage => { @@ -455,7 +457,7 @@ class FetchLogsPre76 extends FetchSysLogsStrategy { return this.restClient.getWorkflowLogsPre76( RUN_SCRIPT_WORKFLOW_ID, this.executionToken, - "debug", + Logger.level, this.lastTimestamp ) } @@ -475,7 +477,7 @@ class FetchLogsPost76 extends FetchSysLogsStrategy { return this.restClient.getWorkflowLogsPost76( RUN_SCRIPT_WORKFLOW_ID, this.executionToken, - "debug", + Logger.level, this.lastTimestamp ) } diff --git a/packages/node/vrdt-common/src/logger.ts b/packages/node/vrdt-common/src/logger.ts index a8b3724e..38eb0ab7 100644 --- a/packages/node/vrdt-common/src/logger.ts +++ b/packages/node/vrdt-common/src/logger.ts @@ -37,6 +37,13 @@ export default class Logger { } } + /** + * Configured log level. + */ + static get level(): LogLevel { + return Logger.logLevel + } + debug(message: string, data?: any): void { if (this.channel && Logger.logLevel === "debug") { this.channel.debug(this.format("DEBUG", message, data)) diff --git a/packages/node/vrdt-common/src/rest/VroRestClient.ts b/packages/node/vrdt-common/src/rest/VroRestClient.ts index 10f4155b..0c5a5ea1 100644 --- a/packages/node/vrdt-common/src/rest/VroRestClient.ts +++ b/packages/node/vrdt-common/src/rest/VroRestClient.ts @@ -321,8 +321,7 @@ export class VroRestClient { "GET", `workflows/${workflowId}/executions/${executionId}/syslogs` + `?conditions=severity=${severity}` + - `&conditions=timestamp${encodeURIComponent(">")}${timestamp}` + - "&conditions=type=system" + `&conditions=timestamp${encodeURIComponent(">")}${timestamp}` // + "&conditions=type=system" ) const messages: LogMessage[] = []