Skip to content

Add $env.NU_LOG_LEVEL to Special Variables #1976

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Kissaki
Copy link
Contributor

@Kissaki Kissaki commented Jul 12, 2025

No description provided.

Copy link
Contributor Author

@Kissaki Kissaki left a comment

Choose a reason for hiding this comment

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

Is it fitting to add a standard library special variable to the list of special variables?

I think it is.

It's a good cross-reference to the availability of the standard library and this submodule in particular.

In this case, it's also a good cross-discoverability for --log-level.

Or should this list of special variables not include the standard library [that has to be included manually for use]?

# => 9
```

Note that `$env.NU_LIB_DIRS` is different from `nu --log-level`, which sets the log level for Nushell commands. It does not influence the `std/log` logging used in custom commands and scripts.
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I was think about whether there is a good, fitting qualifier for Nushell's own commands. In the end I chose not to add any qualifier, and only call the custom commands custom commands as a differentiation (like they are called in the docs).

Suggested change
Note that `$env.NU_LIB_DIRS` is different from `nu --log-level`, which sets the log level for Nushell commands. It does not influence the `std/log` logging used in custom commands and scripts.
Note that `$env.NU_LIB_DIRS` is different from `nu --log-level`, which sets the log level for native Nushell commands. It does not influence the `std/log` logging used in custom commands and scripts.
Suggested change
Note that `$env.NU_LIB_DIRS` is different from `nu --log-level`, which sets the log level for Nushell commands. It does not influence the `std/log` logging used in custom commands and scripts.
Note that `$env.NU_LIB_DIRS` is different from `nu --log-level`, which sets the log level for (native) Nushell commands. It does not influence the `std/log` logging used in custom commands and scripts.

@@ -118,6 +118,37 @@ A list of directories which will be searched when using the `source`, `use`, or
- [Module Path](./modules/using_modules.md#module-path)
- [Configuration - `$NU_LIB_DIRS`](./configuration.md#nu-lib-dirs-constant)

### `$env.NU_LOG_LEVEL`

The [standard library](/book/standard_library.md) offers logging in `std/log`. The `NU_LOG_LEVEL` environment variable is used to define the log level being used.
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Is this - with the mention and reference of standard library - sufficient to clarify the conditional nature of it? That it is not available in a fresh shell session?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant