瀏覽代碼

Degbug log funcions

George Jones 1 年之前
父節點
當前提交
8bf3661d36
共有 1 個文件被更改,包括 21 次插入0 次删除
  1. 21 0
      rc.local/l.sh

+ 21 - 0
rc.local/l.sh

@@ -0,0 +1,21 @@
+#! /bin/bash
+#   logging funciton for one lineers
+#
+#  Usage: l ARGS
+
+NOW=`date +%Y-%fM-%d:%H:m:s`
+LOGDIR="${HOME/var/log}"
+
+if [  "${LOGTO}" == "" ] ; then
+    mkdir -p $LOGDIR
+    LOGFILE="${LOGDIR}/l.log"
+else
+    LOGFILE="${$LOGTO}"
+fi
+
+if  [  $# == 0 ]; then
+    echo Nothing to log
+    return 1
+fi
+
+echo $* >> $LOGFILE