Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions extension/src/client/command/RunAction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -293,7 +292,7 @@ class ActionRunner {
name: "printInOutput",
type: "boolean",
value: {
boolean: { value: !supportsSysLog }
boolean: { value: true }
}
}
]
Expand Down Expand Up @@ -416,6 +415,9 @@ abstract class FetchSysLogsStrategy extends FetchLogsStrategy {
protected abstract getLogMessages(): Promise<LogMessage[]>

async printMessages(): Promise<void> {
if (Logger.level === "off") {
return
}
const timestamp = Date.now() - 10000 // 10sec earlier
const logs = await this.getLogMessages()
logs.forEach(logMessage => {
Expand Down Expand Up @@ -455,7 +457,7 @@ class FetchLogsPre76 extends FetchSysLogsStrategy {
return this.restClient.getWorkflowLogsPre76(
RUN_SCRIPT_WORKFLOW_ID,
this.executionToken,
"debug",
Logger.level,
this.lastTimestamp
)
}
Expand All @@ -475,7 +477,7 @@ class FetchLogsPost76 extends FetchSysLogsStrategy {
return this.restClient.getWorkflowLogsPost76(
RUN_SCRIPT_WORKFLOW_ID,
this.executionToken,
"debug",
Logger.level,
this.lastTimestamp
)
}
Expand Down
7 changes: 7 additions & 0 deletions packages/node/vrdt-common/src/logger.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down
3 changes: 1 addition & 2 deletions packages/node/vrdt-common/src/rest/VroRestClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we can remove the commented condition, probably we won't need it anymore

)

const messages: LogMessage[] = []
Expand Down