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.
This commit is contained in:
parent
445338c496
commit
c8ff3394e6
2
packages/nx/src/native/index.d.ts
vendored
2
packages/nx/src/native/index.d.ts
vendored
@ -249,8 +249,6 @@ export const IS_WASM: boolean
|
||||
|
||||
export declare export declare function logDebug(message: string): void
|
||||
|
||||
export declare export declare function logError(message: string): void
|
||||
|
||||
/** Stripped version of the NxJson interface for use in rust */
|
||||
export interface NxJson {
|
||||
namedInputs?: Record<string, Array<JsInputs>>
|
||||
|
||||
@ -6,9 +6,3 @@ pub fn log_debug(message: String) {
|
||||
enable_logger();
|
||||
debug!(message);
|
||||
}
|
||||
|
||||
#[napi]
|
||||
pub fn log_error(message: String) {
|
||||
enable_logger();
|
||||
error!(message);
|
||||
}
|
||||
|
||||
@ -392,7 +392,6 @@ module.exports.hashFile = nativeBinding.hashFile
|
||||
module.exports.installNxConsole = nativeBinding.installNxConsole
|
||||
module.exports.IS_WASM = nativeBinding.IS_WASM
|
||||
module.exports.logDebug = nativeBinding.logDebug
|
||||
module.exports.logError = nativeBinding.logError
|
||||
module.exports.parseTaskStatus = nativeBinding.parseTaskStatus
|
||||
module.exports.remove = nativeBinding.remove
|
||||
module.exports.restoreTerminal = nativeBinding.restoreTerminal
|
||||
|
||||
@ -17,7 +17,7 @@ import {
|
||||
getTaskDetails,
|
||||
hashTasksThatDoNotDependOnOutputsOfOtherTasks,
|
||||
} from '../hasher/hash-task';
|
||||
import { logError, logDebug, RunMode } from '../native';
|
||||
import { logDebug, RunMode } from '../native';
|
||||
import {
|
||||
runPostTasksExecution,
|
||||
runPreTasksExecution,
|
||||
@ -216,7 +216,7 @@ async function getTerminalOutputLifeCycle(
|
||||
// @ts-ignore
|
||||
return (chunk, encoding, callback) => {
|
||||
if (isError) {
|
||||
logError(
|
||||
logDebug(
|
||||
Buffer.isBuffer(chunk)
|
||||
? chunk.toString(encoding)
|
||||
: chunk.toString()
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user