blob: 709c60da91c5debe8d42c4d390a1c7013aa39b1d (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
|
# Copyright 1999-2000 Gentoo Technologies, Inc.
# Distributed under the terms of the GNU General Public License, v2 or later
# Author Dan Armak <danarmak@gentoo.org>
# $Header: /var/cvsroot/gentoo-x86/eclass/debug.eclass,v 1.4 2001/10/03 17:10:16 danarmak Exp $
# This provides functions for verbose output for debugging
# Note: we check whether these settings are set by "if [ "$FOO" ]; then".
# Therefore set them to true/false only - not yes/no or whatever.
# redirect output, unset to disable
# use e.g. /dev/tty.
# todo: add support for loging into a file.
DEBUG_OUTPUT=""
# used internally for output
# redirects output wherever's needed
# in the future might use e* from /etc/init.d/functions.sh if i feel like it
debug-print() {
[ -n "$DEBUG_OUTPUT" ] || return 0
while [ "$1" ]; do
echo "debug: $1" > $DEBUG_OUTPUT
shift
done
}
# std message functions
debug-print-function() {
str="now in function $1"
shift
debug-print "$str" "parameters: $*"
}
debug-print-section() {
debug-print "now in section $*"
}
|