From: Matteo Nastasi (mop) Date: Sun, 1 Feb 2009 15:50:27 +0000 (+0000) Subject: script to comment disabled log X-Git-Tag: 3.0.0~149 X-Git-Url: http://mop.ddnsfree.com/gitweb/?a=commitdiff_plain;h=55ecf06dfdaa1f95a77f689d38eeb4faeea91ee5;p=brisk.git script to comment disabled log --- diff --git a/bin/logmgr.sh b/bin/logmgr.sh new file mode 100755 index 0000000..60ed7eb --- /dev/null +++ b/bin/logmgr.sh @@ -0,0 +1,45 @@ +#!/bin/bash + +# define(DBG_ONL2, 0x0001); +# define(DBG_ONLY, 0x0002); +# define(DBG_MAIN, 0x0004); +# define(DBG_READ, 0x0008); +# define(DBG_REA2, 0x0010); +# define(DBG_SEND, 0x0020); +# define(DBG_LOCK, 0x0040); +# define(DBG_WRIT, 0x0080); +# define(DBG_LOAD, 0x0100); +# define(DBG_AUTH, 0x0200); +# define(DBG_CRIT, 0x0400); + +actflg="`grep 'define(BRISK_DEBUG,' Obj/brisk.phh | sed 's/.*define(BRISK_DEBUG, *//g;s/).*//g'`" + +if [ "$actflg" == "" ]; then + echo "BRISK_DEBUG define not found" + exit 1 +fi + +ct=0 +for log in log_only2 log_only log_main log_rd log_rd2 log_send log_lock log_wr log_load log_auth log_crit; do + curflg="$((1 << $ct))" + if [ $((actflg & curflg)) -eq 0 ]; then + echo "$log isn't active" + fi + ct=$((ct + 1)) +done + +echo + +for f in $(find | grep '\.ph[pho]'); do + echo $f + ct=0 + sed -i 's@; *// *LogMgr:@@g' $f + for log in log_only2 log_only log_main log_rd log_rd2 log_send log_lock log_wr log_load log_auth log_crit; do + curflg="$((1 << $ct))" + if [ $((actflg & curflg)) -eq 0 ]; then + sed -i "s@$log(\(.*;\)@; // LogMgr:$log(\1@g" $f + fi + ct=$((ct + 1)) + done +done +