clean up some extra logging code in the cli (#7709)

I have been recently going through some info logging in the cli and
noticed that there is too much info being printed to get a handle on
whats going on...

This is an attempt to do some minor logging clean up to print out "less
stuff",
in info logging mode mainly having to do with the prompt...

If someone really want to see what is going on they can very easily add
it
back in without too much trouble.
This commit is contained in:
Michael Angerman 2023-01-08 12:05:46 -08:00 committed by GitHub
parent 95cd9dd2b2
commit 5879b0df99
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,6 +1,6 @@
use crate::util::report_error;
use crate::NushellPrompt;
use log::info;
use log::trace;
use nu_engine::eval_subexpression;
use nu_protocol::{
engine::{EngineState, Stack, StateWorkingSet},
@ -39,7 +39,7 @@ fn get_prompt_string(
// Use eval_subexpression to force a redirection of output, so we can use everything in prompt
let ret_val =
eval_subexpression(engine_state, &mut stack, block, PipelineData::empty());
info!(
trace!(
"get_prompt_string (block) {}:{}:{}",
file!(),
line!(),
@ -59,7 +59,7 @@ fn get_prompt_string(
let block = engine_state.get_block(block_id);
// Use eval_subexpression to force a redirection of output, so we can use everything in prompt
let ret_val = eval_subexpression(engine_state, stack, block, PipelineData::empty());
info!(
trace!(
"get_prompt_string (block) {}:{}:{}",
file!(),
line!(),
@ -148,7 +148,7 @@ pub(crate) fn update_prompt<'prompt>(
);
let ret_val = nu_prompt as &dyn Prompt;
info!("update_prompt {}:{}:{}", file!(), line!(), column!());
trace!("update_prompt {}:{}:{}", file!(), line!(), column!());
ret_val
}