Add a verbosity concept to kubernetes scripts

The KUBE_VERBOSE environment variable sets the verbosity level to
use. Log messages can specify a verbosity by setting the V
variable. e.g.

    V=2 kube::log::info foo bar

Would only print "foo bar" if $KUBE_VERBOSE >= 2.
This commit is contained in:
Tim St. Clair
2016-08-04 17:35:26 -07:00
parent 07b650e165
commit 9abdf719b8
7 changed files with 35 additions and 12 deletions

View File

@@ -21,6 +21,7 @@ set -o nounset
set -o pipefail
KUBE_ROOT=$(dirname "${BASH_SOURCE}")/../..
KUBE_VERBOSE="${KUBE_VERBOSE:-1}"
source "${KUBE_ROOT}/hack/lib/init.sh"
kube::golang::build_binaries "$@"