-
Notifications
You must be signed in to change notification settings - Fork 246
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
Avoid multiple 'set -x' messages for one message output function call (like LogPrint) #3037
Conversation
In lib/_input-output-functions.sh use '2>>/dev/$DISPENSABLE_OUTPUT_DEV' for all functions that output messages (i.e. print on the user's terminal or log something) to avoid that in debugscript mode 'set -x' debug messages about message output functions appear more than once in the log file, e.g. for LogPrint 'text' it would appear three times: one for the initial "LogPrint 'text'" call plus two more for the resulting "Log 'text'" and "Print 'text" calls. Now only one 'set -x' debug message for the initial message output function call appears in the log.
With current master code
With the changes in this pull request:
|
This was since a long time on my personal
made this a real annoyance - at least for me. With the code in
With the code in
|
@schlomo @rear/contributors |
In lib/_input-output-functions.sh have the whole function body of the Log function within { ... } 2>>/dev/$DISPENSABLE_OUTPUT_DEV to have no 'set -x' messages for the Log function. In 5ed5b2e a 'test' command was prepended in the Log function body outside of { ... } 2>>/dev/$DISPENSABLE_OUTPUT_DEV which contradicts the intent of the later #3037 to have no 'set -x' messages for all functions in lib/_input-output-functions.sh that output messages
Some more minor fixes for early Error() in usr/sbin/rear
Type: Enhancement
Impact: Low
Reference to related issue (URL):
Suppress dispensable 'set -x' debug output unless called with '--debugscripts x' #2024
How was this pull request tested?
see below
Brief description of the changes in this pull request:
In lib/_input-output-functions.sh
use '2>>/dev/$DISPENSABLE_OUTPUT_DEV'
for all functions that output messages
(i.e. print on the user's terminal or log something)
to avoid that in debugscript mode 'set -x' debug messages
about message output functions appear more than once in the log file,
e.g. for LogPrint 'text' it would appear three times:
one for the initial "LogPrint 'text'" call
plus two more for the resulting "Log 'text'" and "echo 'text" calls.
Now only one 'set -x' debug message for the initial message output
function call appears in the log.