Skip to content

Commit 1adebca

Browse files
authoredMay 27, 2024··
fix: stop changing logs if flusher is not set (#5676)
1 parent 9a093f5 commit 1adebca

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed
 

‎packages/build/src/log/logger.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ export const getSystemLogger = function (
190190
return (...args) => fileDescriptor.write(`${reduceLogLines(args)}\n`)
191191
}
192192

193-
export const addOutputGate = (logs: Logs, outputFlusher: OutputFlusher): Logs => {
193+
export const addOutputFlusher = (logs: Logs, outputFlusher: OutputFlusher): Logs => {
194194
if (logsAreBuffered(logs)) {
195195
return {
196196
...logs,

‎packages/build/src/steps/core_step.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { setEnvChanges } from '../env/changes.js'
22
import { addErrorInfo, isBuildError } from '../error/info.js'
3-
import { addOutputGate } from '../log/logger.js'
3+
import { addOutputFlusher } from '../log/logger.js'
44

55
import { updateNetlifyConfig, listConfigSideFiles } from './update_config.js'
66

@@ -40,7 +40,7 @@ export const fireCoreStep = async function ({
4040
deployId,
4141
outputFlusher,
4242
}) {
43-
const logsA = addOutputGate(logs, outputFlusher)
43+
const logsA = outputFlusher ? addOutputFlusher(logs, outputFlusher) : logs
4444

4545
try {
4646
const configSideFiles = await listConfigSideFiles([headersPath, redirectsPath])

‎packages/build/src/steps/plugin.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { context, propagation } from '@opentelemetry/api'
22

33
import { addErrorInfo } from '../error/info.js'
4-
import { addOutputGate } from '../log/logger.js'
4+
import { addOutputFlusher } from '../log/logger.js'
55
import { logStepCompleted } from '../log/messages/ipc.js'
66
import { pipePluginOutput, unpipePluginOutput } from '../log/stream.js'
77
import { callChild } from '../plugins/ipc.js'
@@ -43,7 +43,7 @@ export const firePluginStep = async function ({
4343
const otelCarrier = {}
4444
propagation.inject(context.active(), otelCarrier)
4545

46-
const logsA = addOutputGate(logs, outputFlusher)
46+
const logsA = addOutputFlusher(logs, outputFlusher)
4747

4848
try {
4949
const configSideFiles = await listConfigSideFiles([headersPath, redirectsPath])

0 commit comments

Comments
 (0)
Please sign in to comment.