Skip to content

Commit

Permalink
feat: [159] Added optional LogMessage origin (Server/System)
Browse files Browse the repository at this point in the history
Signed-off-by: Mihail Penchev (c) <[email protected]>
  • Loading branch information
bcpmihail committed Oct 11, 2024
1 parent 15f2161 commit c1098b0
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
3 changes: 2 additions & 1 deletion extension/src/client/command/RunAction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -415,7 +415,8 @@ abstract class FetchSysLogsStrategy extends FetchLogsStrategy {
const logs = await this.getLogMessages()
logs.forEach(logMessage => {
const timestamp = moment(logMessage.timestamp).format("YYYY-MM-DD HH:mm:ss.SSS ZZ")
const msg = `[${timestamp}] [${logMessage.severity}] ${logMessage.description}`
const origin = !logMessage.origin ? "" : `[${logMessage.origin}] `
const msg = `[${timestamp}] ${origin}[${logMessage.severity}] ${logMessage.description}`
if (!this.printedMessages.has(msg)) {
this.log(msg)
this.printedMessages.add(msg)
Expand Down
3 changes: 2 additions & 1 deletion packages/node/vrdt-common/src/rest/VroRestClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,8 @@ export class VroRestClient {
messages.push({
timestamp: e["time-stamp"],
severity: e.severity,
description
description,
origin: e.origin
})
}

Expand Down
1 change: 1 addition & 0 deletions packages/node/vrdt-common/src/rest/vro-model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ export interface LogMessage {
timestamp: string
severity: string
description: string
origin?: string
}

export interface Version {
Expand Down

0 comments on commit c1098b0

Please sign in to comment.