Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: stop changing logs if flusher is not set #5676

Merged
merged 2 commits into from
May 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 => {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just renaming the method here to be consistent with the naming we ended up choosing. No functional change.

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
Loading