mirror of
https://github.com/percona/percona-toolkit.git
synced 2025-09-25 13:46:22 +00:00
Update log_warn_die.sh in pt-ioprofile, pt-mysql-summary, and pt-summary.
This commit is contained in:
@@ -22,23 +22,32 @@ PTFUNCNAME=""
|
||||
PTDEBUG="${PTDEBUG:-""}"
|
||||
EXIT_STATUS=0
|
||||
|
||||
log() {
|
||||
TS=$(date +%F-%T | tr ':-' '_');
|
||||
ts() {
|
||||
TS=$(date +%F-%T | tr ':-' '_')
|
||||
echo "$TS $*"
|
||||
}
|
||||
|
||||
info() {
|
||||
[ ${OPT_VERBOSE:-0} -ge 3 ] && ts "$*"
|
||||
}
|
||||
|
||||
log() {
|
||||
[ ${OPT_VERBOSE:-0} -ge 2 ] && ts "$*"
|
||||
}
|
||||
|
||||
warn() {
|
||||
log "$*" >&2
|
||||
[ ${OPT_VERBOSE:-0} -ge 1 ] && ts "$*" >&2
|
||||
EXIT_STATUS=1
|
||||
}
|
||||
|
||||
die() {
|
||||
warn "$*"
|
||||
ts "$*" >&2
|
||||
EXIT_STATUS=1
|
||||
exit 1
|
||||
}
|
||||
|
||||
_d () {
|
||||
[ "$PTDEBUG" ] && echo "# $PTFUNCNAME: $(log "$*")" >&2
|
||||
[ "$PTDEBUG" ] && echo "# $PTFUNCNAME: $(ts "$*")" >&2
|
||||
}
|
||||
|
||||
# ###########################################################################
|
||||
|
Reference in New Issue
Block a user