Skip to content

Commit

Permalink
Merge pull request #207 from FlowFuse/log-passthrough
Browse files Browse the repository at this point in the history
Log passthrough
  • Loading branch information
Steve-Mcl authored Feb 7, 2024
2 parents 493aff9 + 9078fe9 commit 2e86caf
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib/logBuffer.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ class LogBuffer {
this.wrapped = false
this.lastLogTimestamp = 0
this.lastLogTimestampCount = 0
this.passThroughLogging = false
}

add (logEntry) {
Expand All @@ -25,6 +26,8 @@ class LogBuffer {
logEntry.ts = logEntry.ts + ('' + this.lastLogTimestampCount).padStart(4, '0')
if (logEntry.level === 'system') {
console.log(logEntry.msg)
} else if (process.env.FORGE_LOG_PASSTHROUGH) {
console.log(JSON.stringify(logEntry))
}
if (!logEntry.src) {
logEntry.src = instanceId
Expand Down

0 comments on commit 2e86caf

Please sign in to comment.