fix(core): change default native logging to "OFF" (#31161)

<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->
"ERROR" is set as the default logging level when using native logging.
This causes issues with the new function of calling the native logger
from the JS side.

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
"OFF" is set as the default so that no logs appear on stdout if there
was no explicit opt-in.

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
This commit is contained in:
Jonathan Cammisuli 2025-05-09 19:59:10 -04:00 committed by GitHub
parent bf1eec5eca
commit ce1d6b2e6e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -102,8 +102,7 @@ pub(crate) fn enable_logger() {
.with_writer(std::io::stdout)
.event_format(NxLogFormatter)
.with_filter(
EnvFilter::try_from_env("NX_NATIVE_LOGGING")
.unwrap_or_else(|_| EnvFilter::new("ERROR")),
EnvFilter::try_from_env("NX_NATIVE_LOGGING").unwrap_or_else(|_| EnvFilter::new("OFF")),
);
let registry = tracing_subscriber::registry()