forked from extern/nushell
small, backwards compatible enhancements to std (#14763)
# Description Small, backwards compatible enhancements to the standard library. # User-Facing Changes - changed `iter find`, `iter find-index`: Only consume the input stream up to the first match. - added `log set-level`: a small convenience command for setting the log level - added `$null_device`: `null-device` as a const variable, would allow conditional sourcing if #13872 is fixed # Tests + Formatting - 🟢 toolkit fmt - 🟢 toolkit clippy - 🟢 toolkit test - 🟢 toolkit test stdlib # After Submitting N/A
This commit is contained in:
@ -313,3 +313,13 @@ export def custom [
|
||||
|it, acc| $acc | str replace --all $it.0 $it.1
|
||||
})
|
||||
}
|
||||
|
||||
def "nu-complete log-level" [] {
|
||||
log-level | transpose description value
|
||||
}
|
||||
|
||||
# Change logging level
|
||||
export def --env set-level [level: int@"nu-complete log-level"] {
|
||||
# Keep it as a string so it can be passed to child processes
|
||||
$env.NU_LOG_LEVEL = $level | into string
|
||||
}
|
||||
|
Reference in New Issue
Block a user