Skip to Content.
Sympa Menu

sm-commit - [SM-Commit] GIT changes to master sorcery by Paul Mahon (998a1889beb1d735697445093450b1a868618dc8)

sm-commit AT lists.ibiblio.org

Subject: Source Mage code commit list

List archive

Chronological Thread  
  • From: Paul Mahon <scm AT mail.sourcemage.org>
  • To: sm-commit AT lists.ibiblio.org
  • Subject: [SM-Commit] GIT changes to master sorcery by Paul Mahon (998a1889beb1d735697445093450b1a868618dc8)
  • Date: Sat, 13 Jan 2007 14:06:18 -0600

GIT changes to master sorcery by Paul Mahon <dufflebunk AT gmail.com>:

var/lib/sorcery/modules/libdebug | 59
+++++++++++++++++++++++++++++++++++++++
1 files changed, 59 insertions(+)

New commits:
commit 998a1889beb1d735697445093450b1a868618dc8
Author: Paul Mahon <dufflebunk AT gmail.com>
Commit: Paul Mahon <dufflebunk AT gmail.com>

Adding libdebug module

diff --git a/var/lib/sorcery/modules/libdebug
b/var/lib/sorcery/modules/libdebug
new file mode 100644
index 0000000..d3f4cf3
--- /dev/null
+++ b/var/lib/sorcery/modules/libdebug
@@ -0,0 +1,59 @@
+#!/bin/bash
+
+
+#---------------------------------------------------------------------
+## @param type
+## @param message
+##
+## Enters a debug message if the type of debug message != 'n'
+##
+## The 'type' is usually the name of the file the debug statement
+## comes from. i.e. SORCERY_DEBUG_liblock, SORCERY_DEBUG_libsorcery,
+## sorcery_DEBUG_cast etc.
+## The normal way of calling this function is using $STD_SORCERY_DEBUG
+## which adds in the line number and automatically adds the type
+## STD_SORCERY_DEBUG_HEAD also adds the function parameters
+##
+#---------------------------------------------------------------------
+function debug_message() {
+ [[ $SORCERY_DEBUG ]] || return 0
+
+ local debugVar="SORCERY_DEBUG_${1}"
+ local i
+ if ! [[ ${!debugVar} ]] ; then
+ echo -n "$1($$): " >>$SORCERY_DEBUG
+ shift
+ for i in "$@" ; do
+ echo -n " \"$i\"" >>$SORCERY_DEBUG
+ done
+ echo >>$SORCERY_DEBUG
+ fi
+
+ true
+}
+
+function init_debugging() {
+ local i
+ for i in ${SORCERY_DEBUG_FILTER} ; do
+ eval "SORCERY_DEBUG_$i=n"
+ done
+
+ if [[ $SORCERY_DEBUG ]] && [[ $SORCERY_DEBUG != "/dev/null" ]] && touch
$SORCERY_DEBUG 2>/dev/null ; then
+ if [[ $SORCERY_ENTRY_DEBUG != "n" ]] ; then
+ # Standard debug line:
+ # file "function@line" "all" "args"
+ STD_SORCERY_DEBUG_HEAD='eval local _stddbg_file=${BASH_SOURCE[0]} ;
+ _stddbg_file=${_stddbg_file##*/};
+ debug_message "${_stddbg_file}" "${FUNCNAME[0]}@$LINENO" "$@"'
+ else
+ STD_SORCERY_DEBUG_HEAD=':'
+ fi
+ STD_SORCERY_DEBUG='eval local _stddbg_file=${BASH_SOURCE[0]} ;
+ _stddbg_file=${_stddbg_file##*/};
+ debug_message "${_stddbg_file}" "${FUNCNAME[0]}@$LINENO"'
+ else
+ STD_SORCERY_DEBUG_HEAD=':'
+ STD_SORCERY_DEBUG=':'
+ fi
+}
+



  • [SM-Commit] GIT changes to master sorcery by Paul Mahon (998a1889beb1d735697445093450b1a868618dc8), Paul Mahon, 01/13/2007

Archive powered by MHonArc 2.6.24.

Top of Page