Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
echo -ewithprintfin_bash-it-log-message().localpositional parameters to allow for defaults.composure.shfeature to reduce load order dependency.if/thenproperly.$BASH_IT_LOG_PREFIXslightly (eliminate duplicate colons).Motivation and Context
Misuse of
&&/||can cause unexpected return status, so I'm just fixing to useif/thenwherever I see them.echo -eis unreliable and has differing behaviour in different contexts, such as in subshells and whenxpg_echois enabled.printfdoes exactly what it says on the tin. The parameter$messagewas leaking from every log function, so Ilocal'd it. Alsö,localthe rest of the parameters and fill in a default color, default log level, and strip duplicate colons from the message and level.How Has This Been Tested?
Now that #1902 is merged, I can start a whole shell straight off
master!! So, anyway, I have my$BASH_IT_LOG_LEVELset to max in my~/.bashrcso I see all the messages and everything still works.Types of changes
Checklist:
clean_files.txtand formatted it usinglint_clean_files.sh.