Skip to content

Commit

Permalink
fix: stop changing logs if flusher is not set (#5676)
Browse files Browse the repository at this point in the history
  • Loading branch information
eduardoboucas authored May 27, 2024
1 parent 9a093f5 commit 1adebca
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion packages/build/src/log/logger.ts
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ export const getSystemLogger = function (
return (...args) => fileDescriptor.write(`${reduceLogLines(args)}\n`)
}

export const addOutputGate = (logs: Logs, outputFlusher: OutputFlusher): Logs => {
export const addOutputFlusher = (logs: Logs, outputFlusher: OutputFlusher): Logs => {
if (logsAreBuffered(logs)) {
return {
...logs,
Expand Down
4 changes: 2 additions & 2 deletions packages/build/src/steps/core_step.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { setEnvChanges } from '../env/changes.js'
import { addErrorInfo, isBuildError } from '../error/info.js'
import { addOutputGate } from '../log/logger.js'
import { addOutputFlusher } from '../log/logger.js'

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

Expand Down Expand Up @@ -40,7 +40,7 @@ export const fireCoreStep = async function ({
deployId,
outputFlusher,
}) {
const logsA = addOutputGate(logs, outputFlusher)
const logsA = outputFlusher ? addOutputFlusher(logs, outputFlusher) : logs

try {
const configSideFiles = await listConfigSideFiles([headersPath, redirectsPath])
Expand Down
4 changes: 2 additions & 2 deletions packages/build/src/steps/plugin.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { context, propagation } from '@opentelemetry/api'

import { addErrorInfo } from '../error/info.js'
import { addOutputGate } from '../log/logger.js'
import { addOutputFlusher } from '../log/logger.js'
import { logStepCompleted } from '../log/messages/ipc.js'
import { pipePluginOutput, unpipePluginOutput } from '../log/stream.js'
import { callChild } from '../plugins/ipc.js'
Expand Down Expand Up @@ -43,7 +43,7 @@ export const firePluginStep = async function ({
const otelCarrier = {}
propagation.inject(context.active(), otelCarrier)

const logsA = addOutputGate(logs, outputFlusher)
const logsA = addOutputFlusher(logs, outputFlusher)

try {
const configSideFiles = await listConfigSideFiles([headersPath, redirectsPath])
Expand Down

0 comments on commit 1adebca

Please sign in to comment.