Skip to content

Commit 6fe25e9

Browse files
committed
feat: [159] Restored System and Server logs in VRDT OUTPUT
Signed-off-by: Mihail Penchev (c) <pmihail@vmware.com>
1 parent b53c2c4 commit 6fe25e9

3 files changed

Lines changed: 14 additions & 6 deletions

File tree

extension/src/client/command/RunAction.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,6 @@ class ActionRunner {
280280
}
281281

282282
this.logger.info(`Running workflow ${RUN_SCRIPT_WORKFLOW_ID} (vRO ${this.vroVersion})`)
283-
const supportsSysLog = semver.gt(this.vroVersion, "7.3.1")
284283
const params = [
285284
{
286285
name: "script",
@@ -293,7 +292,7 @@ class ActionRunner {
293292
name: "printInOutput",
294293
type: "boolean",
295294
value: {
296-
boolean: { value: !supportsSysLog }
295+
boolean: { value: true }
297296
}
298297
}
299298
]
@@ -416,6 +415,9 @@ abstract class FetchSysLogsStrategy extends FetchLogsStrategy {
416415
protected abstract getLogMessages(): Promise<LogMessage[]>
417416

418417
async printMessages(): Promise<void> {
418+
if (Logger.level === "off") {
419+
return
420+
}
419421
const timestamp = Date.now() - 10000 // 10sec earlier
420422
const logs = await this.getLogMessages()
421423
logs.forEach(logMessage => {
@@ -455,7 +457,7 @@ class FetchLogsPre76 extends FetchSysLogsStrategy {
455457
return this.restClient.getWorkflowLogsPre76(
456458
RUN_SCRIPT_WORKFLOW_ID,
457459
this.executionToken,
458-
"debug",
460+
Logger.level,
459461
this.lastTimestamp
460462
)
461463
}
@@ -475,7 +477,7 @@ class FetchLogsPost76 extends FetchSysLogsStrategy {
475477
return this.restClient.getWorkflowLogsPost76(
476478
RUN_SCRIPT_WORKFLOW_ID,
477479
this.executionToken,
478-
"debug",
480+
Logger.level,
479481
this.lastTimestamp
480482
)
481483
}

packages/node/vrdt-common/src/logger.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,13 @@ export default class Logger {
3737
}
3838
}
3939

40+
/**
41+
* Configured log level.
42+
*/
43+
static get level(): LogLevel {
44+
return Logger.logLevel
45+
}
46+
4047
debug(message: string, data?: any): void {
4148
if (this.channel && Logger.logLevel === "debug") {
4249
this.channel.debug(this.format("DEBUG", message, data))

packages/node/vrdt-common/src/rest/VroRestClient.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -321,8 +321,7 @@ export class VroRestClient {
321321
"GET",
322322
`workflows/${workflowId}/executions/${executionId}/syslogs` +
323323
`?conditions=severity=${severity}` +
324-
`&conditions=timestamp${encodeURIComponent(">")}${timestamp}` +
325-
"&conditions=type=system"
324+
`&conditions=timestamp${encodeURIComponent(">")}${timestamp}` // + "&conditions=type=system"
326325
)
327326

328327
const messages: LogMessage[] = []

0 commit comments

Comments
 (0)