summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Armak <danarmak@gentoo.org>2001-10-01 13:54:38 +0000
committerDan Armak <danarmak@gentoo.org>2001-10-01 13:54:38 +0000
commit975902e589effb2bf5b3355fba521f0d823e0c81 (patch)
tree28106b6a94705d76ea6cff5c29fc89c13539b206 /eclass/debug.eclass
parenteclasses v3. read the gentoo-dev announcement, and news.txt and howto.* (diff)
downloadhistorical-975902e589effb2bf5b3355fba521f0d823e0c81.tar.gz
historical-975902e589effb2bf5b3355fba521f0d823e0c81.tar.bz2
historical-975902e589effb2bf5b3355fba521f0d823e0c81.zip
eclasses v3.1
added debug.eclass and fixed many bugs
Diffstat (limited to 'eclass/debug.eclass')
-rw-r--r--eclass/debug.eclass44
1 files changed, 44 insertions, 0 deletions
diff --git a/eclass/debug.eclass b/eclass/debug.eclass
new file mode 100644
index 000000000000..54d929c071bf
--- /dev/null
+++ b/eclass/debug.eclass
@@ -0,0 +1,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.1 2001/10/01 13:54:38 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/tty12 for quiet uotput out of harm's way.
+# todo: add support for loging into a file.
+DEBUG_OUTPUT="/dev/tty"
+
+# 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 $*"
+
+}
+