diff options
| -rwxr-xr-x | bin/ak | 28 | ||||
| -rwxr-xr-x | lib/_ak_fs | 1 | ||||
| -rwxr-xr-x | lib/_ak_log | 16 |
3 files changed, 36 insertions, 9 deletions
@@ -17,7 +17,7 @@ ### You should have received a copy of the GNU General Public License ### along with this program. If not, see <http://www.gnu.org/licenses/>. ### -export AK_DEBUG="no" +export AK_DEBUG=0 export AK_DEBUG_IRC="no" ## ## Arching Kaos CLI tool is the main executable script to use for exploring, @@ -63,9 +63,29 @@ then export AK_DEBUG="no" shift fi +if [ "$1" == "-vvvvv" ] +then + export AK_DEBUG=5 + shift +fi +if [ "$1" == "-vvvv" ] +then + export AK_DEBUG=4 + shift +fi +if [ "$1" == "-vvv" ] +then + export AK_DEBUG=3 + shift +fi +if [ "$1" == "-vv" ] +then + export AK_DEBUG=2 + shift +fi if [ "$1" == "-v" ] then - export AK_DEBUG="yes" + export AK_DEBUG=1 shift fi @@ -81,11 +101,11 @@ then args="-h" if [ -n "$subcmd" ] then - echo $subcmd | cut -d '-' -f 2 | sort | uniq | sed -e 's/^/ak /g' + echo $subcmd | cut -d '-' -f 2 | sort | uniq #| sed -e 's/^/ak /g' #$(echo $subcmd) $args fi done - ) | sort | uniq | sed 's/^/# /g' | while read line; do _ak_log_info "$line";done + ) | sort | uniq #| sed 's/^/# /g' | while read line; do _ak_log_info "$line";done exit 1 fi @@ -747,6 +747,7 @@ function _ak_fs_from_map_net_get_original_filename(){ _ak_log_error "${reply} doesn't contain the appropriate info" exit 1 fi + cp ${reply} $AK_MAPSDIR/$1 cat ${reply} | head -n 1 | awk '{print $2}' break fi diff --git a/lib/_ak_log b/lib/_ak_log index d28e663..9d4f8c3 100755 --- a/lib/_ak_log +++ b/lib/_ak_log @@ -155,8 +155,14 @@ function _ak_log_message(){ then echo "$TS" "<$prg>" "[$tp]" "$msg" >> $AK_LOGSFILE fi - if [ ! -z $AK_DEBUG ] && [ -n "$AK_DEBUG" ] && [ "$AK_DEBUG" == "yes" ] + if [ ! -z $AK_DEBUG ] && [ -n "$AK_DEBUG" ] # && [ $AK_DEBUG -gt 0 ] then + case $tp in + INFO) if [[ $AK_DEBUG -lt 1 ]]; then return ;fi ;; + # ERROR) if [[ $AK_DEBUG -lt 2 ]]; then return ;fi ;; + WARNING) if [[ $AK_DEBUG -lt 3 ]]; then return ;fi ;; + DEBUG|EXIT) if [[ $AK_DEBUG -lt 5 ]]; then return ;fi ;; + esac _ak_log_print_log_line "$TS <$prg> [$tp] $msg" >&2 fi if [ ! -z $AK_DEBUG_IRC ] && [ -n "$AK_DEBUG_IRC" ] && [ "$AK_DEBUG_IRC" == "yes" ] @@ -164,8 +170,8 @@ function _ak_log_message(){ _ak_log_print_log_line_irc "$TS <$prg> [$tp] $msg" >&2 fi else - echo "$TS" "<$prg>" "[ERROR]" "No message" >> $AK_LOGSFILE - if [ "$AK_DEBUG" == "yes" ] + echo "$TS" "<$prg>" "[ERROR]" "No message" >> $AK_LOGSFILE + if [ $AK_DEBUG -eq 5 ] then echo "$TS" "<$prg>" "[ERROR]" "No message" >&2 fi @@ -176,7 +182,7 @@ function _ak_log_message(){ then echo "$TS" "<$prg>" "[ERROR]" "No type and message" >> $AK_LOGSFILE fi - if [ "$AK_DEBUG" == "yes" ] + if [ $AK_DEBUG -eq 5 ] then echo "$TS" "<$prg>" "[ERROR]" "No type and message" >&2 fi @@ -187,7 +193,7 @@ function _ak_log_message(){ then echo "$TS" "<$(basename $0)>" "[ERROR]" "No arguments given" >> $AK_LOGSFILE fi - if [ "$AK_DEBUG" == "yes" ] + if [ $AK_DEBUG -eq 5 ] then echo "$TS" "<$(basename $0)>" "[ERROR]" "No arguments given" >&2 fi |
