Skip to content

Commit c8ff339

Browse files
authored
fix(core): remove log_error function and standardize logging (#31515)
## Current Behavior The codebase has separate `logError` and `logDebug` functions in the native logging infrastructure, with both error and debug logging paths. ## Expected Behavior Consolidate logging to use a single standardized approach. Error messages are now logged through the debug channel for consistency. ## Related Issue(s) This change standardizes the logging interface by removing the separate error logging function and routing all log messages through the debug logger.
1 parent 445338c commit c8ff339

File tree

4 files changed

+2
-11
lines changed

4 files changed

+2
-11
lines changed

packages/nx/src/native/index.d.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -249,8 +249,6 @@ export const IS_WASM: boolean
249249

250250
export declare export declare function logDebug(message: string): void
251251

252-
export declare export declare function logError(message: string): void
253-
254252
/** Stripped version of the NxJson interface for use in rust */
255253
export interface NxJson {
256254
namedInputs?: Record<string, Array<JsInputs>>

packages/nx/src/native/logger/console.rs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,3 @@ pub fn log_debug(message: String) {
66
enable_logger();
77
debug!(message);
88
}
9-
10-
#[napi]
11-
pub fn log_error(message: String) {
12-
enable_logger();
13-
error!(message);
14-
}

packages/nx/src/native/native-bindings.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -392,7 +392,6 @@ module.exports.hashFile = nativeBinding.hashFile
392392
module.exports.installNxConsole = nativeBinding.installNxConsole
393393
module.exports.IS_WASM = nativeBinding.IS_WASM
394394
module.exports.logDebug = nativeBinding.logDebug
395-
module.exports.logError = nativeBinding.logError
396395
module.exports.parseTaskStatus = nativeBinding.parseTaskStatus
397396
module.exports.remove = nativeBinding.remove
398397
module.exports.restoreTerminal = nativeBinding.restoreTerminal

packages/nx/src/tasks-runner/run-command.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ import {
1717
getTaskDetails,
1818
hashTasksThatDoNotDependOnOutputsOfOtherTasks,
1919
} from '../hasher/hash-task';
20-
import { logError, logDebug, RunMode } from '../native';
20+
import { logDebug, RunMode } from '../native';
2121
import {
2222
runPostTasksExecution,
2323
runPreTasksExecution,
@@ -216,7 +216,7 @@ async function getTerminalOutputLifeCycle(
216216
// @ts-ignore
217217
return (chunk, encoding, callback) => {
218218
if (isError) {
219-
logError(
219+
logDebug(
220220
Buffer.isBuffer(chunk)
221221
? chunk.toString(encoding)
222222
: chunk.toString()

0 commit comments

Comments
 (0)