nushell/src
Devyn Cairns a3bc85bb5f
Add options for filtering the log output from nu (#13044)
# Description

Add `--log-include` and `--log-exclude` options to filter the log output
from `nu` to specific module prefixes. For example,

```nushell
nu --log-level trace --log-exclude '[nu_parser]'
```

This avoids having to scan through parser spam when trying to debug
something else at `TRACE` level, and should make it feel much more
reasonable to add logging, particularly at `TRACE` level, to various
places in the codebase. It can also be used to debug non-Nushell crates
that support the Rust logging infrastructure, as many do.

You can also include a specific module instead of excluding the parser
log output:

```nushell
nu --log-level trace --log-include '[nu_plugin]'
```

Pinging #13041 for reference, but hesitant to outright say that this
closes that. I think it address that concern though. I've also struggled
with debugging plugin stuff with all of the other output, so this will
really help me there.

# User-Facing Changes

- New `nu` option: `--log-include`
- New `nu` option: `--log-exclude`
2024-06-05 16:42:55 +08:00
..
command.rs Add options for filtering the log output from nu (#13044) 2024-06-05 16:42:55 +08:00
config_files.rs Revert "Remove std::env::set_current_dir() call from EngineState::merge_env()" (#12954) 2024-05-24 11:09:59 -05:00
ide.rs Use CommandType in more places (#12832) 2024-05-18 23:37:31 +00:00
logger.rs Add options for filtering the log output from nu (#13044) 2024-06-05 16:42:55 +08:00
main.rs Add options for filtering the log output from nu (#13044) 2024-06-05 16:42:55 +08:00
README.md Remove old nushell/merge engine-q 2022-02-07 14:54:06 -05:00
run.rs Refactor the CLI code a bit (#12782) 2024-05-10 07:29:27 +08:00
signals.rs Add command_prelude module (#12291) 2024-03-26 21:17:30 +00:00
terminal.rs Deduplicate nix dependency versions (#12307) 2024-03-27 16:43:37 +01:00
test_bins.rs Revert "Remove std::env::set_current_dir() call from EngineState::merge_env()" (#12954) 2024-05-24 11:09:59 -05:00

Nushell REPL

This directory contains the main Nushell REPL (read eval print loop) as part of the CLI portion of Nushell, which creates the nu binary itself.

Current versions of the nu binary will use the Nu argument parsing logic to parse the commandline arguments passed to nu, leaving the logic here to be a thin layer around what the core libraries.