aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rwxr-xr-xlib/_ak_fs1
-rwxr-xr-xlib/_ak_log16
2 files changed, 12 insertions, 5 deletions
diff --git a/lib/_ak_fs b/lib/_ak_fs
index 3d5ed71..4a502fd 100755
--- a/lib/_ak_fs
+++ b/lib/_ak_fs
@@ -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