MT#18811 Send debug output to stderr

If we send debug output to stdout then its output might get used
in variable assignments, causing debug runs to have different
results than the non-debug ones, like:

| root@sp2:/etc/ngcp-config# DEBUG=1 ngcpcfg build --no-action-failure /etc/mysql/
| 2016-03-30 18:58:00: DEBUG: sourced configuration file /etc/ngcp-config/ngcpcfg.cfg
| 2016-03-30 18:58:00: DEBUG: sourced configuration file /etc/ngcp-config/ngcpcfg.d/shared_storage.cfg
| 2016-03-30 18:58:00: DEBUG: /usr/share/ngcp-ngcpcfg/scripts//build --no-action-failure /etc/mysql/
| 2016-03-30 18:58:00: DEBUG: sourced configuration file /etc/ngcp-config/ngcpcfg.cfg
| 2016-03-30 18:58:00: DEBUG: sourced configuration file /etc/ngcp-config/ngcpcfg.d/shared_storage.cfg
| 2016-03-30 18:58:00: DEBUG: sourced configuration file /etc/ngcp-config/ngcpcfg.cfg
| 2016-03-30 18:58:00: DEBUG: sourced configuration file /etc/ngcp-config/ngcpcfg.d/shared_storage.cfg
| 2016-03-30 18:58:00: Error: branch '2016-03-30 18:58:00: DEBUG: get_active_branch master
| 2016-03-30 18:58:00: DEBUG: cd /etc/ngcp-config
| 2016-03-30 18:58:00: DEBUG: current_branch = master
| master' in '/etc/ngcp-config' active - please switch to branch 'master' before continuing.

Change-Id: I58a8882054b9accdff14d79e9a963109f2bbb91f
changes/31/5431/1
Michael Prokop 10 years ago
parent ec17e502fc
commit 1fd2247ce3

@ -176,6 +176,8 @@ Options
**--debug** <action> [<further_options>]::
Run actions (see next section) in verbose mode, useful for debugging.
Debug output will be sent to syslog (available as /var/log/ngcp/ngcpcfg.log on
NGCP systems) as well as stderr.
**--help**::

@ -44,7 +44,7 @@ log_error() {
log_debug() {
if [ -n "${DEBUG:-}" ] ; then
logger -t ngcpcfg -- "Debug: $*"
console_output "DEBUG: $*\n"
console_output "DEBUG: $*\n" >&2
fi
}

Loading…
Cancel
Save